/* ==========================================================================
   currency.css — Blue-theme currency styling (updated to match date.css visuals)
   - Darker input outlines, curved icon divider, result rectangle
   - Primary filled pill retained; small pale-blue pill variant added
   - Checkbox / radio outline parity
   - Drop-in replacement: paste over css/currency.css
   ========================================================================== */

/* THEME TOKENS (tool-scoped) */
.currency-card,
.currency-tool,
#currency-section {
  --card-radius: 14px;
  --card-pad: 16px;
  --control-radius: 10px;

  /* Use timezone vars if present, otherwise fallback to blue */
  --cu-primary: var(--tz-accent, #2B7BE4);
  --cu-primary-700: var(--tz-accent-700, #185FCC);
  --cu-contrast: #ffffff;

  --cu-bg: #F4F8FF;
  --cu-surface: #ffffff;
  --cu-ink: #0B223B;
  --cu-muted: #5d6b7a;
  --cu-border: rgba(24,95,204,0.06);
  --cu-border-strong: rgba(11,34,59,0.16);
  --cu-shadow: 0 12px 36px rgba(11,34,59,0.04);
  --cu-glow: rgba(43,123,228,0.10);
}

/* Card shell */
.currency-card {
  position: relative;
  border-radius: var(--card-radius);
  padding: calc(var(--card-pad) + 8px);
  background: linear-gradient(180deg, #f8fbff, #f4f8ff);
  border: 1px solid rgba(24,95,204,0.04);
  box-shadow: var(--cu-shadow);
  color: var(--cu-ink);
  isolation: isolate;
  -webkit-font-smoothing: antialiased;
}

/* Accent stroke across top */
.currency-card::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  height: 6px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--cu-primary), var(--cu-primary-700));
  box-shadow: 0 10px 28px rgba(43,123,228,0.10);
  opacity: 0.98;
  z-index: 4;
  pointer-events: none;
}

/* Section title and badge */
.currency-card .section-title {
  font-weight: 800;
  font-size: 1.08rem;
  letter-spacing: -0.01em;
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--cu-ink);
  margin-top: 6px; /* sits under the accent stroke */
  position: relative;
  z-index: 8;
}
.currency-card .section-title i {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.02));
  color: var(--cu-primary-700);
  font-size: 1.05rem;
  box-shadow: 0 8px 20px rgba(11,34,59,0.04);
}

/* Inputs / input groups — pill surface, clear contrast, darker outline */
.currency-card .input-group {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--cu-border-strong); /* stronger dark outline */
  background: linear-gradient(180deg, #ffffff, #fbfefb);
  display: flex;
  align-items: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
  position: relative;
}

/* Curved divider between icon cell and input (like date.css) */
.currency-card .input-group::after {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: calc( (var(--icon-w,50px)) ); /* aligns with icon width if set */
  width: 1px;
  background: rgba(0,0,0,0.12);
  border-radius: 2px;
  pointer-events: none;
}

/* Fallback: if icon width not set, use 50px as default */
.currency-card .input-group .input-icon-cell { width: 50px; min-width: 50px; }

/* input-group-text / icon cell */
.currency-card .input-group-text,
.currency-card .input-icon-cell {
  min-width: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--cu-primary-700);
  font-weight: 800;
  z-index: 2; /* keep above divider */
}

/* Form controls: remove bootstrap border, keep padded pill look */
.currency-card .form-control,
.currency-card .form-select,
.currency-card input,
.currency-card select {
  border: none;
  padding: 10px 12px;
  font-weight: 700;
  color: var(--cu-ink);
  background: transparent;
  z-index: 2; /* above divider line */
  -webkit-appearance: none;
}

/* Focus state for inputs (stronger outline) */
.currency-card .form-control:focus,
.currency-card .form-select:focus,
.currency-card input:focus,
.currency-card select:focus {
  outline: none;
  box-shadow: 0 6px 18px rgba(43,123,228,0.08);
  border-color: rgba(11,34,59,0.22);
}

/* Primary control (View Historical Trends) — blue filled pill */
.currency-card #toggle-trends,
.currency-card .btn.primary,
.currency-card .btn--primary {
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 800;
  color: var(--cu-contrast);
  background: linear-gradient(90deg, var(--cu-primary), var(--cu-primary-700));
  border: none;
  box-shadow: 0 12px 34px rgba(24,95,204,0.12);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}
.currency-card #toggle-trends:hover,
.currency-card .btn.primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 44px rgba(24,95,204,0.16);
}

/* Pale-blue small pill (Reset/Today style) — available if you want secondary action to match */
.currency-card .btn.pale-pill {
  background: linear-gradient(180deg,#E6F1FF,#DDEBFF) !important;
  color: #072243 !important;
  border: 1px solid rgba(24,95,204,0.12) !important;
  padding: 8px 14px !important;
  border-radius: 10px !important;
  font-weight: 800 !important;
  font-size: 0.94rem !important;
  box-shadow: 0 8px 28px rgba(24,95,204,0.08) !important;
  display:inline-flex;
  gap:8px;
  align-items:center;
  transition: transform 140ms ease, box-shadow 140ms ease, filter 120ms ease;
}

/* Secondary small buttons (chart/table/export) */
.currency-card .btn-group .btn,
.currency-card .btn-outline {
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 700;
  background: linear-gradient(180deg, #fff, #fffef8);
  border: 1px solid rgba(11,34,59,0.04);
  color: var(--cu-ink);
}
.currency-card .btn-group .btn.active,
.currency-card .btn-group .btn:active {
  background: linear-gradient(90deg, var(--cu-primary), var(--cu-primary-700));
  color: var(--cu-contrast);
  box-shadow: 0 12px 30px rgba(24,95,204,0.10);
}

/* Result area — clean rounded rectangle */
#currency-result {
  margin-top: 14px;
  padding: 16px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid rgba(11,34,59,0.04);
  box-shadow: 0 8px 26px rgba(11,34,59,0.04);
  color: var(--cu-ink);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.45;
  min-height: 60px;
  position: relative;
}

/* History controls container appearance */
#history-chart-container {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  background: linear-gradient(180deg, #fff, #fffef8);
  border: 1px solid rgba(24,95,204,0.04);
  box-shadow: 0 8px 20px rgba(24,95,204,0.03);
}

/* History table scroller */
#history-table-container {
  margin-top: 10px;
  max-height: 300px;
  overflow-y: auto;
  border-radius: 10px;
  border: 1px solid rgba(11,34,59,0.03);
  background: #fff;
}

/* Rate badge */
.currency-card .rate-badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 800;
  background: rgba(43,123,228,0.06);
  color: var(--cu-primary-700);
  border: 1px solid rgba(43,123,228,0.08);
}

/* small misc */
.currency-card i { color: var(--cu-primary-700); }

/* small muted helper */
.currency-card .text-muted { color: var(--cu-muted); }

/* checkboxes / radios style parity if present */
.currency-card .form-check-input {
  width: 18px;
  height: 18px;
  margin-top: 0.12rem;
  margin-right: 0.5rem;
  box-shadow: inset 0 1px 0 #fff;
  accent-color: var(--cu-primary);
  border: 2px solid rgba(11,34,59,0.12);
  background-color: #fff;
  -webkit-appearance: auto;
}
.currency-card .form-check-input[type="radio"] { border-radius: 50%; }
.currency-card .form-check-input:focus { outline: none; box-shadow: 0 0 0 4px rgba(43,123,228,0.08); }

/* focus-visible ring consistent with others */
.currency-card :focus-visible, .currency-card .btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 6px rgba(43,123,228,0.08);
}

/* spacing & layout tuning */
.currency-card .section-title + .lead,
.currency-card .section-title + .text-muted {
  display:block;
  margin-top:6px;
  font-weight:700;
  opacity:0.78;
}

/* Add breathing room under controls so card content matches timezone spacing */
.currency-card .row.g-3 { margin-bottom: 10px; }

/* Responsive adjustments */
@media (max-width: 720px) {
  .currency-card { padding: 12px; }
  .currency-card .section-title { font-size: 1rem; }
  .currency-card #toggle-trends { width: 100%; }
  #history-chart-container, #history-table-container { padding: 8px; }
  /* ensure divider doesn't overlap on small inputs */
  .currency-card .input-group::after { left: 50px; }
}

/* Defensive specificity anchor */
body .currency-card { /* anchor */ }

/* === Fix: ensure icons inside active/selected buttons are visible ===
   - Icons inherit the button text color so they turn white on blue backgrounds
   - Remove any accidental filters or color overrides
   - Covers primary button, active btn-group buttons, pale-pill, and toggle-trends
====================================================================== */

.currency-card .btn i,
.currency-card .btn .bi,
.currency-card .btn svg {
  color: inherit !important;        /* inherit the button text color */
  fill: currentColor !important;    /* svg icon fallback */
  stroke: currentColor !important;  /* svg stroke fallback */
  filter: none !important;          /* remove any filter that mutes visibility */
  opacity: 1 !important;
  transition: color 120ms ease;
}

/* Active / selected buttons: ensure icon and text contrast */
.currency-card .btn.active,
.currency-card .btn:active,
.currency-card .btn:focus,
.currency-card .btn.active i,
.currency-card .btn:active i,
.currency-card .btn:focus i {
  color: var(--cu-contrast) !important;   /* usually white on blue */
  fill: var(--cu-contrast) !important;
  stroke: var(--cu-contrast) !important;
}

/* Specifically handle the case where active state uses a gradient background:
   make sure the icon inherits the computed color and remains visible */
.currency-card .btn.active .bi,
.currency-card .btn.active svg,
.currency-card #toggle-trends i {
  color: var(--cu-contrast) !important;
  fill: var(--cu-contrast) !important;
  stroke: var(--cu-contrast) !important;
}

/* If you used pale-pill variant (pale background) but want a blue icon there:
   keep the icon in that case tinted to --cu-primary-700 */
.currency-card .btn.pale-pill i,
.currency-card .btn.pale-pill .bi {
  color: var(--cu-primary-700) !important;
  fill: var(--cu-primary-700) !important;
  stroke: var(--cu-primary-700) !important;
}

/* Defensive: if an icon is wrapped by an SVG <use> element, ensure visibility */
.currency-card svg use { fill: currentColor !important; }

/* Small spacing / vertical alignment fix for tiled buttons */
.currency-card .btn .bi { margin-right: 8px; vertical-align: middle; }

/* === Icons inherit button color and SVGs use currentColor === */
.currency-card .btn i,
.currency-card .btn svg,
.currency-card .btn .bi {
  color: inherit !important;
  fill: currentColor !important;
  stroke: currentColor !important;
  filter: none !important;
}

/* Active/selected button normally uses white text/icon (on blue bg) */
.currency-card .btn.active,
.currency-card .btn:active,
.currency-card .btn:focus {
  color: var(--cu-contrast) !important;
  fill: var(--cu-contrast) !important;
  stroke: var(--cu-contrast) !important;
}

/* BUT: keep the Export CSV button ICON / text blue even when active (so it doesn't vanish)
   Adjust the selector to the exact button id/class in your HTML if different */
#download-csv,
#download-csv i,
#download-csv .bi,
#download-csv svg {
  color: var(--cu-primary-700) !important;
  fill: var(--cu-primary-700) !important;
  stroke: var(--cu-primary-700) !important;
}

/* If you have an active class toggled on export button, keep it blue too */
#download-csv.active,
#download-csv:active,
#download-csv:focus {
  background: transparent !important;     /* keep background unchanged when clicked */
  color: var(--cu-primary-700) !important;
  border-color: rgba(24,95,204,0.12) !important;
  box-shadow: none !important;
}

/* Another fallback: any .btn-outline or .btn.pale-pill should keep blue icons (not white) */
.currency-card .btn-outline i,
.currency-card .btn-outline svg,
.currency-card .btn.pale-pill i,
.currency-card .btn.pale-pill svg {
  color: var(--cu-primary-700) !important;
  fill: var(--cu-primary-700) !important;
  stroke: var(--cu-primary-700) !important;
}

/* === Force single-line rate + date in #currency-result === */
#currency-result {
  white-space: nowrap;              /* keep both bits on same line */
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 10px;
}

#currency-result .rate-meta,
#currency-result .rate-meta * {
  white-space: nowrap;
}

/* fallback for the JS structure that uses two divs:
   show them inline and reduce vertical spacing if wrapped */
#currency-result > div { display: inline-block; vertical-align: middle; margin: 0; }
#currency-result > div.text-muted { opacity: .78; font-size: .92rem; margin-left: 8px; }

/* ====== currency: make small "Range" dropdown visible + accessible ======
   This single authoritative block makes the Range select visible with an SVG arrow
   and avoids multiple conflicting overrides. Keep it at the end of the file.
===================================================================== */

#history-range,
.currency-card .form-select,
.currency-card select {
  background: linear-gradient(180deg,#ffffff,#fbfdfb) !important;
  border: 1.5px solid rgba(11,34,59,0.12) !important;
  box-shadow: inset 0 2px 6px rgba(11,34,59,0.02) !important;
  color: #0B223B !important;
  font-weight: 800 !important;
  height: 40px !important;
  padding: 8px 40px 8px 12px !important;    /* space for arrow on right */
  border-radius: 10px !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'><path d='M7 10l5 5 5-5' stroke='%232B7BE4' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 14px 14px !important;
  z-index: 9999 !important; /* bring above overlays without using extreme z */
  position: relative !important;
  display: inline-block !important;
  vertical-align: middle !important;
  pointer-events: auto !important;
  cursor: pointer !important;
}

/* Remove legacy IE arrow */
#history-range::-ms-expand { display:none !important; }

/* Focus visuals */
#history-range:focus {
  outline: none !important;
  box-shadow: 0 6px 20px rgba(43,123,228,0.10) !important;
  border-color: rgba(24,95,204,0.20) !important;
}

/* Keep width behavior */
#history-range.w-auto { width: auto !important; }

/* Vertical centering fix when inside small-height containers */
.form-label[for="history-range"] + #history-range,
#history-range.form-select {
  display: inline-block;
  vertical-align: middle;
}

/* mobile: slightly reduce arrow size and padding */
@media (max-width: 520px) {
  #history-range { padding-right: 30px !important; background-position: right 10px center !important; background-size: 10px 10px !important; min-width:72px !important; height:40px !important; padding-left:10px !important;}
}

/* ---------- numeric spinner (columns) parity ---------- */
.currency-card input[type=number]::-webkit-inner-spin-button,
.currency-card input[type=number]::-webkit-outer-spin-button { -webkit-appearance:auto !important; display:inline-flex !important; opacity:1 !important; pointer-events:auto !important; }

/* ======= Force: make the Range dropdown look exactly like the USD currency selects =======
   Paste at the very end of the final CSS file loaded on the page (base.css or overrides.css)
   =========================================================================== */

#history-range,
.currency-card #history-range,
.currency-card .history-range,
.range-select,
select#history-range {
  /* pill geometry (same as USD) */
  background: linear-gradient(180deg,#ffffff,#fbfdfb) !important;
  border: 1.5px solid rgba(11,34,59,0.12) !important;
  box-shadow: inset 0 2px 6px rgba(11,34,59,0.02) !important;
  color: #0B223B !important;
  font-weight: 800 !important;
  height: 40px !important;
  padding: 8px 40px 8px 12px !important;    /* room for arrow on right */
  border-radius: 10px !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 14px 14px !important;
  /* inline SVG arrow matching currency accent */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'><path d='M7 10l5 5 5-5' stroke='%232B7BE4' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>") !important;
  z-index: 9999 !important;
  position: relative !important;
  display: inline-block !important;
  vertical-align: middle !important;
  cursor: pointer !important;
}

/* keep legacy IE arrow hidden */
#history-range::-ms-expand { display: none !important; }

/* Focus / hover parity with USD */
#history-range:focus,
.currency-card #history-range:focus,
.range-select:focus {
  outline: none !important;
  box-shadow: 0 6px 20px rgba(43,123,228,0.10) !important;
  border-color: rgba(24,95,204,0.20) !important;
}

/* fallback width behaviour */
#history-range.w-auto { width: auto !important; }

/* mobile tweak */
@media (max-width:520px) {
  #history-range,
  .currency-card #history-range {
    padding-right: 30px !important;
    background-position: right 10px center !important;
    background-size: 11px 11px !important;
    height: 40px !important;
    min-width: 72px !important;
  }
}

/* ===== result layout + responsive "Rate as of" ===== */
#currency-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;               /* allow meta to wrap on narrow screens */
  padding: 12px;
  border-radius: 12px;
}

/* primary rate text */
#currency-result .rate-main {
  font-weight: 800;
  font-size: 1rem;
  color: var(--cu-ink, #0B223B);
  flex: 1 1 auto;
  min-width: 0; /* allow text truncation if extremely narrow */
}

/* the "(Rate as of ...)" meta */
#currency-result .rate-meta {
  font-weight: 700;
  color: var(--cu-muted, #5d6b7a);
  white-space: nowrap;           /* keep it single-line on desktop */
  flex: 0 0 auto;
}

/* On small screens, force the meta onto its own line */
@media (max-width: 520px) {
  #currency-result {
    padding-top: 10px;
    padding-bottom: 10px;
  }
  #currency-result .rate-meta {
    flex-basis: 100%;
    white-space: normal;         /* allow wrap and show on next line */
    margin-top: 6px;
  }
}

/* Make the moved trends button align nicely when placed after the result */
.currency-card #toggle-trends {
  width: 100%;
  box-sizing: border-box;
  margin-top: 10px;
}

/* Small spacing refinement so the result block visually matches timezone/date cards */
.currency-card .row.g-3 + #currency-result {
  margin-top: 6px;
}

/* Only add a border to Table / Chart / Export CSV buttons */
.currency-card .history-actions .btn,
.currency-card .history-actions button,
.currency-card .btn-group .btn,
#download-csv {
  border: 1px solid rgba(0,0,0,0.15) !important;  /* subtle border */
  border-radius: 10px !important;                 /* same as reset */
}

/* FORCE: make the trends toggle visually identical to calculate (high specificity) */
body .currency-card #toggle-trends,
body .currency-card .toggle-trends,
body #historicalToggle,
body .historical-toggle,
body .btn-toggle-trends {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px !important;
  padding: 12px 24px !important;
  border-radius: 14px !important;
  font-weight: 900 !important;
  font-size: 1rem !important;
  color: var(--cu-contrast) !important;
  background: linear-gradient(90deg, var(--cu-primary), var(--cu-primary-700)) !important;
  border: none !important;
  box-shadow: 0 20px 50px rgba(24,95,204,0.18) !important;
  transition: transform 200ms ease, box-shadow 200ms ease !important;
  box-sizing: border-box !important;
  min-width: 190px !important; /* baseline fallback */
}

/* hover/focus parity */
body .currency-card #toggle-trends:hover,
body .currency-card .toggle-trends:hover,
body #historicalToggle:hover { transform: translateY(-6px) !important; box-shadow: 0 28px 70px rgba(24,95,204,0.26) !important; }

@media (max-width:720px) {
  body .currency-card #toggle-trends,
  body .currency-card .toggle-trends,
  body #historicalToggle { width: 100% !important; min-width: 0 !important; }
}

/* Prevent trends toggle from stretching inside flex containers (desktop) */
#toggle-trends,
#historicalToggle,
.toggle-trends,
.historical-toggle,
.gtt-toggle-matched,
.gtt-toggle-fixed {
  /* do not allow flex-grow in parent flex layouts */
  flex: 0 0 auto !important;
  align-self: center !important;
  display: inline-flex !important;
  width: auto !important;
  max-width: none !important;
  min-width: 149px !important; /* matched to calculate button */
  box-sizing: border-box !important;
}

/* On small screens, allow full-width (behaves like calculate button) */
@media (max-width: 720px) {
  #toggle-trends,
  #historicalToggle,
  .toggle-trends,
  .historical-toggle {
    width: 100% !important;
    min-width: 0 !important;
    flex: 0 0 auto !important; /* still prevent odd grow behavior */
  }
}

/* FORCE: Put rate date (rate-meta) on the next line, on all screen sizes */
body .currency-card #currency-result {
  display: flex !important;
  flex-direction: column !important; /* stack main then meta */
  align-items: flex-start !important;
  justify-content: flex-start !important;
  gap: 6px !important;
  white-space: normal !important;
}

body .currency-card #currency-result .rate-main {
  display: block !important;
  width: 100% !important;
  white-space: normal !important;
  margin: 0 !important;
  font-weight: 800 !important; /* keep emphasis like before */
}

body .currency-card #currency-result .rate-meta {
  display: block !important;
  width: 100% !important;
  margin-top: 4px !important;
  white-space: normal !important;
  font-weight: 700 !important;
  color: inherit !important;
  font-size: 0.95rem !important;
}

/* =============== Currency Select Box Improvements ================= */

/* Make boxes longer horizontally, smaller vertically */
.currency-select-long {
  min-width: 260px !important;
  width: 330px !important;
  max-width: 420px !important;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Remove flag from left icon — keep only currency symbol */
#from-icon .gtt-flag-img,
#to-icon .gtt-flag-img {
  display: none !important;
}

/* Align [View Historical Trends] beside the range dropdown */
#range-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

#toggle-trends {
  margin-top: 0 !important;
  white-space: nowrap;
}

/* ----- Force correct visuals for history action buttons ----- */
/* Apply with high specificity so it works even if buttons move in DOM */
#view-table, #view-chart, #export-csv, #download-csv {
  border-radius: 10px !important;
  padding: 8px 12px !important;
  font-weight: 700 !important;
  min-width: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: none !important;
}

/* Inactive default (white surface, dark text) */
#view-table,
#view-chart:not(.active),
#export-csv,
#download-csv {
  background: linear-gradient(180deg,#fff,#fffef8) !important;
  color: #111827 !important;
  border: 1px solid rgba(11,34,59,0.06) !important;
  box-shadow: none !important;
}

/* Chart active: blue pill */
#view-chart.active,
#view-chart[aria-pressed="true"] {
  background: linear-gradient(90deg, var(--cu-primary, #2B7BE4), var(--cu-primary-700, #185FCC)) !important;
  color: #ffffff !important;
  border: 1px solid rgba(43,123,228,0.24) !important;
  box-shadow: 0 12px 30px rgba(24,95,204,0.10) !important;
}

/* Table active: also use blue fill (same as .btn-group .btn.active behaviour) */
#view-table.active,
#view-table[aria-pressed="true"] {
  background: linear-gradient(90deg, var(--cu-primary, #2B7BE4), var(--cu-primary-700, #185FCC)) !important;
  color: #ffffff !important;
  border: 1px solid rgba(43,123,228,0.12) !important;
  box-shadow: 0 12px 30px rgba(24,95,204,0.10) !important;
}

/* Export CSV should keep blue text / outline — even when inside "active" group */
#export-csv,
#download-csv {
  background: #fff !important;
  color: var(--cu-primary, #2B7BE4) !important;
  border: 1px solid rgba(43,123,228,0.12) !important;
}

/* If export receives .active accidentally, keep its icon/text blue */
#export-csv.active, #export-csv[aria-pressed="true"],
#download-csv.active, #download-csv[aria-pressed="true"] {
  background: #fff !important;
  color: var(--cu-primary, #2B7BE4) !important;
  border-color: rgba(43,123,228,0.12) !important;
  box-shadow: none !important;
}

/* Ensure icons inherit button color */
#view-table .bi, #view-chart .bi, #export-csv .bi, #download-csv .bi { color: inherit !important; fill: currentColor !important; stroke: currentColor !important; }

/* small mobile row tweak to avoid overlap */
@media (max-width: 520px) {
  .currency-card .history-actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
  #view-table, #view-chart, #export-csv { flex: 0 1 auto; }
}

/* Mobile: compact history action buttons (fit content) */
@media (max-width: 520px) {
  #view-table, #view-chart, #export-csv, #download-csv {
    padding: 6px 10px !important;
    font-size: 0.95rem !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: 140px !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    flex: 0 0 auto !important;
  }

  #view-table i, #view-chart i, #export-csv i, #download-csv i,
  #view-table .bi, #view-chart .bi, #export-csv .bi, #download-csv .bi {
    margin-right: 6px !important;
    font-size: 1.05em !important;
  }

  .currency-card .history-actions .btn,
  .currency-card .btn-group .btn {
    flex: 0 0 auto !important;
    min-width: 0 !important;
  }

  .currency-card .history-actions { gap: 8px !important; flex-wrap: wrap !important; }
}

/* Fix ONLY the swap column */
.currency-card .row > .col-md-3 {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Fix swap button */
#gtt-swap-btn {
  height: 46px !important;
  width: 46px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Make the entire row behave like flex */
.currency-card .row {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px;
}

/* Make all columns auto width */
.currency-card .row > div {
  flex: 0 0 auto !important;
  width: auto !important;
}

/* Swap button styling */
#gtt-swap-btn {
  height: 46px;
  width: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Force layout into 2 rows */
.currency-card .row {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: 12px;
}

/* Row 1: Amount full width */
.currency-card .col-md-3:nth-child(1) {
  flex: 0 0 100% !important;
  display: flex;
  justify-content: center;
}

/* Row 2: USD + Swap + INR */
.currency-card .col-md-3:nth-child(2),
.currency-card .col-md-3:nth-child(3),
.currency-card .col-md-3:nth-child(4) {
  flex: 0 0 auto !important;
  display: flex;
  align-items: center;
}

/* Center second row nicely */
.currency-card .col-md-3:nth-child(2) { margin-left: auto; }
.currency-card .col-md-3:nth-child(4) { margin-right: auto; }

/* Swap button clean size */
#gtt-swap-btn {
  height: 46px !important;
  width: 46px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: #28a745;
  border-radius: 50%;
  display: inline-block;
  animation: blink 1s infinite;
}

@keyframes blink {
  0% { opacity: 1; }
  50% { opacity: 0.2; }
  100% { opacity: 1; }
}