/* Scoped reset */
.ptax-wrap, .ptax-wrap * { box-sizing: border-box; }
.ptax-wrap input, .ptax-wrap select, .ptax-wrap button { font: inherit; line-height: 1.25; }
.ptax-wrap img { max-width: 100%; height: auto; }
.ptax-wrap h1,h2,h3,h4,h5,h6 { margin: 0; font-weight: 700; }
.ptax-wrap p { margin: 0; }
.ptax-wrap a { color: inherit; }
.ptax-wrap { max-width: 1100px; margin: 16px auto; padding: 0 12px; font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; color: #111827; }
.ptax-compact .ptax-card { padding: 14px; border-radius: 14px; }
.ptax-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 16px; padding: 18px; margin: 12px 0; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.ptax-card-sticky { position: sticky; top: 0; z-index: 10; backdrop-filter: blur(6px); background: rgba(255,255,255,.92); }
.ptax-header { display:flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.ptax-title { display:flex; gap:12px; align-items:center; }
.ptax-title h1 { font-size: 18px; }
.ptax-title p { color: #6b7280; font-size: 12px; }
.ptax-icon { font-size: 22px; }
.ptax-grid { display:grid; grid-template-columns: repeat(3,1fr); gap:12px; }
.ptax-grid-compact { grid-template-columns: 1fr; }
@media (min-width: 820px) { .ptax-grid-compact { grid-template-columns: 1fr 1fr 1fr; } }
.ptax-grid label { font-weight: 600; font-size: 13px; }
.ptax-grid select { width:100%; padding: 12px 12px; border:1px solid #e5e7eb; border-radius: 12px; background:#fff; }
.ptax-hint { color:#6b7280; font-size:12px; }
.ptax-last { font-size: 22px; font-weight: 700; }
.ptax-section-title { font-weight: 600; margin-bottom: 8px; display:flex; align-items:center; gap:8px; }
.ptax-status { color:#6b7280; font-size: 13px; margin-bottom: 8px; min-height: 18px; }
.ptax-chart-wrap { position: relative; height: 260px; }
@media (min-width: 768px) { .ptax-chart-wrap { height: 320px; } }
.ptax-chart-wrap canvas { display:block; }
/* Conversor layout */
.ptax-conv { display:grid; grid-template-columns: minmax(230px,1.6fr) 56px minmax(230px,1.6fr) minmax(110px,.7fr) minmax(200px,1.2fr); gap: 10px; align-items:end; }
.ptax-conv .ptax-col label { font-weight: 600; font-size: 13px; }
.ptax-select { width:100%; padding: 12px 12px; border:1px solid #e5e7eb; border-radius: 12px; background:#fff; font-size: 16px; -webkit-appearance:none; appearance:none; }
.ptax-conv input { width:100%; padding: 12px 12px; border:1px solid #e5e7eb; border-radius: 12px; background:#fff; font-size: 16px; }
.ptax-swap { display:flex; align-items:end; justify-content:center; }
#ptax-swap-btn { width:44px; height:44px; border:1px solid #e5e7eb; background:#fff; border-radius:999px; cursor:pointer; font-size: 18px; }
#ptax-swap-btn:hover { background:#f9fafb; }
/* Resultado estilizado */
.ptax-result { padding: 12px; border:1px solid #e5e7eb; border-radius: 12px; background:#fff; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 46px; display:flex; align-items:center; }
/* Mobile grid-areas */
@media (max-width: 640px) {
  .ptax-card { margin: 10px 0; padding: 14px; border-radius: 14px; }
  .ptax-title h1 { font-size: 16px; }
  .ptax-conv { grid-template-columns: 1fr 50px 1fr; grid-template-areas: "from swap to" "amount amount amount" "result result result"; gap: 8px; }
  .ptax-from { grid-area: from; }
  .ptax-to { grid-area: to; }
  .ptax-swap { grid-area: swap; }
  .ptax-amount { grid-area: amount; }
  .ptax-output { grid-area: result; }
  .ptax-select, .ptax-conv input, .ptax-result { font-size: 16px; }
}
.ptax-table-wrap { overflow:auto; border-radius: 12px; border:1px solid #e5e7eb; display:none; }
@media (min-width: 900px) { .ptax-table-wrap { display:block; } }
.ptax-table { width:100%; border-collapse: collapse; font-size: 14px; }
.ptax-table thead tr { background:#f9fafb; }
.ptax-table th, .ptax-table td { padding:10px 12px; border-bottom:1px solid #f3f4f6; }
.ptax-table .right { text-align:right; }
.ptax-cards-mobile { display:block; }
@media (min-width: 900px) { .ptax-cards-mobile { display:none; } }
.ptax-mobile-card { border:1px solid #e5e7eb; background:#f9fafb; border-radius:12px; padding:10px; margin:8px 0; }
.ptax-mobile-date { font-size:12px; color:#6b7280; }
.ptax-mobile-grid { display:grid; grid-template-columns: repeat(3,1fr); gap: 8px; font-size: 14px; margin-top:6px; }
.ptax-mobile-grid .k { color:#6b7280; font-size: 12px; }
.ptax-mobile-grid .v { font-weight: 600; }
.ptax-foot { text-align:center; color:#6b7280; font-size:12px; margin: 8px 0 24px; }
.ptax-presets { display:flex; gap:8px; overflow-x:auto; padding-bottom:6px; }
.ptax-pill { padding:8px 12px; border:1px solid #e5e7eb; border-radius:999px; cursor:pointer; background:#fff; font-size:13px; white-space:nowrap; }
.ptax-pill.active { background: var(--ptax-accent, #111827); color:#fff; border-color: var(--ptax-accent, #111827); }
.no-scrollbar::-webkit-scrollbar { display:none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.ptax-select-wrap.is-custom { position: relative; }
.ptax-select-wrap.is-custom select { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.ptax-custom-trigger { width:100%; padding: 12px; border:1px solid #e5e7eb; border-radius:12px; background:#fff; text-align:left; cursor:pointer; min-height:46px; }
.ptax-custom-trigger::after { content: '▾'; float:right; opacity:.6; }
.ptax-custom-panel { position:absolute; z-index: 20; left:0; right:0; top: calc(100% + 6px); border:1px solid #e5e7eb; background:#fff; border-radius:12px; box-shadow: 0 10px 30px rgba(0,0,0,.08); display:none; }
.ptax-custom-panel.open { display:block; }
.ptax-custom-head { padding:8px; border-bottom:1px solid #f3f4f6; }
.ptax-custom-search { width:100%; padding:10px 12px; border:1px solid #e5e7eb; border-radius:10px; }
.ptax-custom-list { max-height: 260px; overflow:auto; padding:4px; }
.ptax-custom-item { display:block; width:100%; text-align:left; padding:10px 12px; border-radius:8px; border:0; background:transparent; cursor:pointer; }
.ptax-custom-item:hover { background:#f5f6f8; }
.ptax-custom-item strong { margin-right:6px; }
.ptax-is-mobile .ptax-custom-panel { position: fixed; left:0; right:0; bottom:0; top:auto; transform: translateY(100%); transition: transform .2s ease; border-radius: 16px 16px 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,.18); }
.ptax-is-mobile .ptax-custom-panel.open { transform: translateY(0); display:block; }
.ptax-is-mobile .ptax-custom-head { position: sticky; top:0; background:inherit; padding:12px; }
.ptax-is-mobile .ptax-drag { width:44px; height:4px; border-radius:999px; background:#d1d5db; margin: 6px auto 10px; }
.ptax-lock-scroll { overflow:hidden; }
/* Dark */
.ptax-dark { background:#0b0b0f; color:#e5e7eb; }
.ptax-dark .ptax-card { background:#12121a; border-color:#1f2937; }
.ptax-dark .ptax-card-sticky { background: rgba(18,18,26,.92); }
.ptax-dark .ptax-table-wrap { border-color:#1f2937; }
.ptax-dark .ptax-table thead tr { background:#0f172a; }
.ptax-dark .ptax-pill { background:#111827; color:#e5e7eb; border-color:#1f2937; }
.ptax-dark .ptax-pill.active { background: var(--ptax-accent, #2563eb); border-color: var(--ptax-accent, #2563eb); }
.ptax-dark #ptax-swap-btn { background:#0f172a; border-color:#1f2937; }
.ptax-dark .ptax-result { background:#0f172a; border-color:#1f2937; }
.ptax-dark .ptax-mobile-card { background:#0f172a; border-color:#1f2937; }
.ptax-dark .ptax-mobile-grid .k { color:#94a3b8; }
.ptax-dark .ptax-custom-panel { background:#12121a; border-color:#1f2937; }
.ptax-dark .ptax-custom-item:hover { background:#0f172a; }
.ptax-dark .ptax-custom-search { background:#0f172a; border-color:#1f2937; color:#e5e7eb; }
@media (prefers-color-scheme: dark) {
  .ptax-auto-dark { background:#0b0b0f; color:#e5e7eb; }
  .ptax-auto-dark .ptax-card { background:#12121a; border-color:#1f2937; }
  .ptax-auto-dark .ptax-card-sticky { background: rgba(18,18,26,.92); }
  .ptax-auto-dark .ptax-table-wrap { border-color:#1f2937; }
  .ptax-auto-dark .ptax-table thead tr { background:#0f172a; }
  .ptax-auto-dark .ptax-pill { background:#111827; color:#e5e7eb; border-color:#1f2937; }
  .ptax-auto-dark .ptax-pill.active { background: var(--ptax-accent, #2563eb); border-color: var(--ptax-accent, #2563eb); }
  .ptax-auto-dark #ptax-swap-btn { background:#0f172a; border-color:#1f2937; }
  .ptax-auto-dark .ptax-result { background:#0f172a; border-color:#1f2937; }
  .ptax-auto-dark .ptax-custom-panel { background:#12121a; border-color:#1f2937; }
  .ptax-auto-dark .ptax-custom-item:hover { background:#0f172a; }
  .ptax-auto-dark .ptax-custom-search { background:#0f172a; border-color:#1f2937; color:#e5e7eb; }
}
