:root{
  --csq-primary:#0F766E;        /* Deep Teal */
  --csq-primary-700:#0B4F4A;
  --csq-bg:#F7F7F8;
  --csq-text:#111827;
  --csq-muted:#6B7280;
  --csq-border:#E5E7EB;

  --csq-accent:#F59E0B;         /* Amber (ONLY CTA + NEV pill) */

  --csq-success:#16A34A;
  --csq-warning:#D97706;
  --csq-error:#DC2626;
  }
  /* Layout */
  #csq-finder { max-width: 520px; margin: 18px auto; padding: 0 12px; touch-action: manipulation; }
  @media (min-width: 768px) {
    #csq-finder { max-width: 600px; }
  }

  #csq_inputs_wrap { margin-top: 24px; }

  #csq_more{
    margin-top: 10px;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1;
  }

  .csq-card {
    border: 1px solid #e7e7e7;
    border-radius: 14px;
    padding: 18px;
    background: #fff;
    box-shadow: 0 1px 0 rgba(0,0,0,0.02);
    /* Prevent "jumping": reserve vertical space for reveals */
    min-height: 420px;
  }

  .csq-btn-apply{
    border-color: var(--csq-primary);
    background: var(--csq-primary);
    color: #fff;
  }
  .csq-btn-apply:hover{ filter: brightness(0.97); }
  .csq-btn-apply:active{ transform: translateY(1px); }

  .csq-title { margin: 0; font-size: 18px; font-weight: 900; }
  .csq-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
  .csq-block { margin-top: 12px; }
  .csq-block-tight { margin-top: 10px; }
  .csq-label { display:block; font-weight: 600; margin-bottom: 6px; }
  .csq-select, .csq-input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #dcdcdc;
    border-radius: 10px;
    font-size: 16px;
    outline: none;
  }
  .csq-select:focus, .csq-input:focus{
  border-color:rgba(15,118,110,0.55);
  box-shadow:0 0 0 3px rgba(15,118,110,0.12);
  }
  .csq-hint { margin-top: 10px; color: #666; font-size: 13px; line-height: 1.35; padding-bottom: 8px; } /* padding fix */
  .csq-helper { margin-top: 8px; color: #333; font-size: 13px; line-height: 1.35; }
  .csq-subtitle { font-weight: 700; margin-bottom: 6px; }
  .csq-subhint { color:#666; font-size:13px; margin-bottom: 10px; }

  /* Money input with prefix */
  .csq-money { position: relative; }
  .csq-currency {
    position:absolute; left: 12px; top: 50%;
    transform: translateY(-50%);
    font-weight: 700; color:#666; font-size: 13px;
    pointer-events:none;
  }
  .csq-input { padding-left: 52px; }


  .csq-modal-x{
    border:none;
    background:transparent;
    padding:6px 8px;
    font-size:22px;
    line-height:1;
    font-weight:900;
    color:var(--csq-muted);
    cursor:pointer;
  }
  .csq-modal-x:hover{ color:var(--csq-text); }
  .csq-modal-x:focus{ outline:none; }
  .csq-modal-x:focus-visible{
    box-shadow:0 0 0 3px rgba(15,118,110,0.14);
    border-radius:10px;
  }

  /* Button */
  .csq-btn{
    width:100%;
    margin-top:14px;
    padding:12px 14px;
    font-weight:800;
    border-radius:10px;

    text-decoration:none !important;

    border:1px solid var(--csq-accent);
    background:var(--csq-accent);
    color:var(--csq-text);

    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    text-align:center;

    transition:transform 180ms ease, filter 180ms ease, background-color 180ms ease;
  }
  /* Hover rules (scoped so ghost/apply remain readable) */
  .csq-btn:not(.csq-btn-ghost):not(.csq-btn-apply):hover{ filter:brightness(0.97); color:var(--csq-text); }
  .csq-btn-ghost:hover{ background:rgba(15,118,110,0.06); color:var(--csq-primary-700); }
  .csq-btn-apply:hover{ filter:brightness(0.97); color:#fff; }
  .csq-btn:active{ transform:translateY(1px); }
  .csq-btn:disabled{ opacity:.55; cursor:not-allowed; }

  .csq-nev-pill{
    margin-top:10px;
    display:inline-flex;
    align-items:center;
    padding:6px 10px;
    border-radius:999px;

    border:1px solid rgba(245,158,11,0.30);
    background:rgba(245,158,11,0.14);
    color:var(--csq-text);

    font-weight:900;
    font-size:12px;
    white-space:nowrap;
  }


  /* Beta band */
  .csq-beta {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #fff;
    padding: 10px 0 12px 0;
    border-bottom: 1px solid #efefef;
    margin-bottom: 10px;
  }
  .csq-beta-row { display:flex; align-items:center; justify-content:space-between; gap: 10px; }
  .csq-badge {
    display:inline-flex; align-items:center;
    font-size: 12px; font-weight: 800;
    padding: 5px 9px;
    border-radius: 999px;
    background: #111;
    color: #fff;
  }
  .csq-link {
    border: none;
    background: transparent;
    padding: 6px 0;
    font-weight: 700;
    font-size: 13px;
    color: #111;
    cursor: pointer;
    text-decoration: underline;
  }
  .csq-beta-copy { color:#333; font-size: 13px; line-height: 1.35; }
  .csq-beta-privacy { margin-top: 6px; color:#666; font-size: 13px; line-height: 1.35; padding-bottom: 8px; border-bottom: 1px solid #efefef; margin-bottom: 10px; }

  /* Subtitle row + info */
  .csq-subtitle-row { display:flex; align-items:center; justify-content:space-between; gap: 10px; }
  .csq-icon-btn {
    width: 34px; height: 34px;
    border-radius: 10px;
    border: 1px solid #e7e7e7;
    background: #fff;
    font-weight: 800;
    cursor: pointer;
  }
  .csq-icon-btn:hover { filter: brightness(0.98); }
  .csq-info { font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial; }
  .csq-tip {
    margin-top: 8px;
    padding: 10px 12px;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 12px;
    color: #333;
    font-size: 13px;
    line-height: 1.35;
  }

  /* Errors */
  .csq-error {
    margin-top: 8px;
    padding: 10px 12px;
    background: #fff5f5;
    border: 1px solid #ffd6d6;
    border-radius: 12px;
    color: #7a1d1d;
    font-size: 13px;
    line-height: 1.35;
  }

  /* Results */
  .csq-results { margin-top: 14px; }
  .csq-results-head { margin-top: 8px; }
  .csq-results-title { font-weight: 800; }
  .csq-results-sub { color:#666; font-size: 13px; margin-top: 4px; }
  .csq-list { display:flex; flex-direction: column; gap: 10px; margin-top: 10px; }
  .csq-empty { margin-top: 12px; color:#666; font-size: 13px; line-height: 1.35; }

  .csq-cardrow {
    border: 1px solid #eee;
    border-radius: 14px;
    background: #fff;
    padding: 12px;
  }
  .csq-rowhead { display:flex; align-items:flex-start; gap: 10px; }
  .csq-logo {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: #f3f3f3;
    object-fit: contain;
    flex: 0 0 auto;
  }
  .csq-cardname {
    font-weight: 900;
    font-size: 14px;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
  }
  .csq-bank { color:#666; font-size: 13px; margin-top: 2px; }
  .csq-grow { flex: 1; min-width: 0; }
  .csq-nev {
    margin-top: 6px;
    color: #111;
    font-weight: 900;
    font-size: 13px;
    line-height: 1.1;
  }
  .csq-meta {
    margin-top: 10px;
    color:#333;
    font-size: 13px;
    display:flex;
    flex-direction: column;
    gap: 6px;
  }
  .csq-actions { margin-top: 10px; display:flex; gap: 10px; }

    /* Compact card-row actions */
  .csq-actions .csq-btn{
    margin-top:0;
    padding:10px 12px;
    font-size:13px;
    font-weight:800;
    border-radius:10px;
    line-height:1;
  }

  .csq-btn-ghost{
    border:1px solid var(--csq-border);
    background:#fff;
    color:var(--csq-primary);
  }

  /* Modal (Learn more) */
  .csq-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 2147483646;
  }
  .csq-modal {
    position: fixed;
    left: 12px; right: 12px;
    top: 12%;
    max-width: 520px;
    margin: 0 auto;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #eee;
    z-index: 2147483647;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    overflow: hidden;
  }
  .csq-modal-head { display:flex; align-items:center; justify-content:space-between; gap: 10px; padding: 12px 12px 10px 12px; border-bottom: 1px solid #f0f0f0; }
  .csq-modal-title { font-weight: 900; }
  .csq-modal-body { padding: 12px; }
  .csq-modal-section { margin-top: 10px; }
  .csq-modal-h { font-weight: 800; margin-bottom: 4px; }
  .csq-modal-p { color:#333; font-size: 13px; line-height: 1.35; }

  /* Bottom sheet (Details) */
  .csq-sheet {
    position: fixed;
    left: 0; right: 0;
    bottom: 0;
    z-index: 2147483647;
    background: #fff;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    border: 1px solid #eee;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.12);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    touch-action: manipulation;
  }
  .csq-sheet-head { padding: 12px; border-bottom: 1px solid #f0f0f0; display:flex; align-items:flex-start; justify-content:space-between; gap: 10px; }
  .csq-sheet-titlewrap { display:flex; align-items:center; gap: 10px; min-width: 0; }
  .csq-sheet-logo { width: 28px; height: 28px; border-radius: 10px; background:#f3f3f3; object-fit: contain; }
  .csq-sheet-title { font-weight: 900; }
  .csq-sheet-sub { color:#666; font-size: 13px; margin-top: 2px; }
  .csq-sheet-body { padding: 12px; overflow: auto; }
  .csq-sheet-hero { padding: 10px 12px; background:#fafafa; border:1px solid #eee; border-radius: 14px; }
  .csq-sheet-nev { font-weight: 900; font-size: 16px; }
  .csq-sheet-nev-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  }
  .csq-sheet-nev-row .csq-icon-circle{ flex: 0 0 auto; }
  .csq-sheet-break { margin-top: 6px; color:#333; font-size: 13px; line-height: 1.35; }
  .csq-sheet-chips { margin-top: 10px; display:flex; gap: 8px; flex-wrap: wrap; }
  .csq-chip { display:inline-flex; padding: 6px 9px; border-radius: 999px; border: 1px solid #e7e7e7; background: #fff; font-size: 12px; font-weight: 800; color:#111; }
  .csq-sheet-section { margin-top: 14px; }
  .csq-sheet-h { font-weight: 900; margin-bottom: 6px; }
  .csq-ul { margin: 0; padding-left: 18px; color:#333; font-size: 13px; line-height: 1.35; }
  .csq-kv { color:#333; font-size: 13px; line-height: 1.55; }
  .csq-sheet-dis { color:#666; font-size: 12px; margin-top: 6px; }
  .csq-sheet-foot { padding: 12px; border-top: 1px solid #f0f0f0; display:flex; gap: 10px; }
  .csq-sheet-foot .csq-btn { flex: 1; text-decoration: none; display: flex; align-items: center; justify-content: center; text-align: center;}

  @media (min-width: 720px) {
    .csq-sheet { left: 50%; transform: translateX(-50%); max-width: 600px; border-radius: 18px; }
  }

  /* Reveal / fade-in */
  .csq-reveal { opacity: 1; transform: translateY(0); transition: opacity 180ms ease, transform 180ms ease; }
  .csq-hidden { opacity: 0; transform: translateY(6px); pointer-events: none; height: 0; overflow: hidden; margin-top: 0; }
  /* Overlays (modal/sheet/backdrops) should not use height:0 hiding */
  .csq-overlay.csq-hidden { display: none; height: auto; overflow: visible; margin-top: 0; transform: none; }
  .csq-shown { opacity: 1; transform: translateY(0); pointer-events: auto; height: auto; overflow: visible; }

  /* Split bar */
  .csq-splitbar {
    display: flex;
    height: 18px;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid #e5e5e5;
    background: #f3f3f3;
  }
  .seg { height: 100%; transition: flex-basis 240ms ease; }

  /* Split segment colors (multi-color for readability) */
  .seg-travel{background:#2563EB;}
  .seg-international{background:#7C3AED;}
  .seg-dining{background:#F97316;}
  .seg-groceries{background:#16A34A;}
  .seg-shopping{background:#0F766E;}
  .seg-utilities{background:#64748B;}

  .dot-travel{background:#2563EB;}
  .dot-international{background:#7C3AED;}
  .dot-dining{background:#F97316;}
  .dot-groceries{background:#16A34A;}
  .dot-shopping{background:#0F766E;}
  .dot-utilities{background:#64748B;}

  /* Legend: 3 rows (2 per row) */
  .csq-legend {
    margin-top: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 14px;
    font-size: 13px;
    color: #333;
  }
  .leg { display:flex; align-items:center; justify-content:space-between; gap: 10px; }
  .leg > span:nth-child(2) { flex: 1; }
  .pct { color:#666; font-variant-numeric: tabular-nums; }
  .dot { width:10px; height:10px; border-radius: 50%; display:inline-block; }

  .csq-icon-circle{
    width:22px;height:22px;
    border-radius:999px;
    border:1px solid var(--csq-border);
    background:#fff;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    font-weight:900;
    font-size:12px;
    line-height:1;
    color:var(--csq-muted);
    cursor:pointer;
    user-select:none;
    padding:0;
    transition:filter 180ms ease;
    -webkit-tap-highlight-color: transparent;
    appearance: none;
  }
  .csq-icon-circle:hover{ filter:brightness(0.98); }
  .csq-icon-circle:active{ filter:brightness(0.98); }
  .csq-icon-circle:focus{ outline:none; box-shadow:none; }
  .csq-icon-circle:focus-visible{
    box-shadow:0 0 0 3px rgba(15,118,110,0.14);
    border-color:rgba(15,118,110,0.55);
  }

  .csq-out{ font-size:12px; margin-left:6px; opacity:0.9; }

  /* Mobile default: stack actions */
  .csq-actions { flex-direction: column; }
  .csq-actions .csq-btn { width: 100%; }

  /* Wider screens: show actions side-by-side */
  @media (min-width: 520px) {
    .csq-actions { flex-direction: row; }
    .csq-actions .csq-btn { width: auto; flex: 1; }
  }

  /* (Removed wider screens: side by side for .csq-actions) */
  @keyframes csqPulse {
    0% { background: transparent; }
    30% { background: rgba(17,17,17,0.04); }
    100% { background: transparent; }
  }
  .csq-flash {
    border-radius: 12px;
    animation: csqPulse 520ms ease-out;
  }