/* ==========================================================================
   Forex Tools — Shared Design System
   ForexMT4Indicators.com
   ========================================================================== */

/* --- Custom Properties --- */
:root {
  /* Primary palette */
  --fx-blue-900: #0a1628;
  --fx-blue-800: #0f2240;
  --fx-blue-700: #142e54;
  --fx-blue-600: #1a3a68;
  --fx-blue-500: #2563eb;
  --fx-blue-400: #3b82f6;
  --fx-blue-100: #dbeafe;
  --fx-blue-50: #eff6ff;

  /* Accent — green for profit / positive */
  --fx-green-600: #059669;
  --fx-green-500: #10b981;
  --fx-green-100: #d1fae5;
  --fx-green-50: #ecfdf5;

  /* Red for loss / negative / errors */
  --fx-red-600: #dc2626;
  --fx-red-500: #ef4444;
  --fx-red-100: #fee2e2;
  --fx-red-50: #fef2f2;

  /* Amber for warnings */
  --fx-amber-500: #f59e0b;
  --fx-amber-100: #fef3c7;

  /* Neutrals */
  --fx-gray-900: #111827;
  --fx-gray-800: #1f2937;
  --fx-gray-700: #374151;
  --fx-gray-600: #4b5563;
  --fx-gray-500: #6b7280;
  --fx-gray-400: #9ca3af;
  --fx-gray-300: #d1d5db;
  --fx-gray-200: #e5e7eb;
  --fx-gray-100: #f3f4f6;
  --fx-gray-50: #f9fafb;
  --fx-white: #ffffff;

  /* Semantic tokens */
  --fx-bg: var(--fx-white);
  --fx-bg-alt: var(--fx-gray-50);
  --fx-text: var(--fx-gray-900);
  --fx-text-secondary: var(--fx-gray-600);
  --fx-text-muted: var(--fx-gray-400);
  --fx-border: var(--fx-gray-200);
  --fx-primary: var(--fx-blue-500);
  --fx-primary-hover: var(--fx-blue-600);
  --fx-success: var(--fx-green-500);
  --fx-error: var(--fx-red-500);
  --fx-warning: var(--fx-amber-500);

  /* Typography */
  --fx-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --fx-font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  /* Spacing scale (4px base) */
  --fx-space-1: 0.25rem;
  --fx-space-2: 0.5rem;
  --fx-space-3: 0.75rem;
  --fx-space-4: 1rem;
  --fx-space-5: 1.25rem;
  --fx-space-6: 1.5rem;
  --fx-space-8: 2rem;
  --fx-space-10: 2.5rem;
  --fx-space-12: 3rem;
  --fx-space-16: 4rem;

  /* Radii */
  --fx-radius-sm: 0.375rem;
  --fx-radius: 0.5rem;
  --fx-radius-lg: 0.75rem;
  --fx-radius-xl: 1rem;

  /* Shadows */
  --fx-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --fx-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --fx-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --fx-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);

  /* Transitions */
  --fx-transition: 150ms ease;

  /* Layout */
  --fx-max-width: 800px;
  --fx-max-width-wide: 1100px;
}


/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--fx-font);
  color: var(--fx-text);
  background: var(--fx-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--fx-primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}


/* --- Typography --- */
h1, h2, h3, h4 {
  line-height: 1.25;
  font-weight: 700;
  color: var(--fx-gray-900);
}

h1 { font-size: 1.875rem; margin-bottom: var(--fx-space-4); }
h2 { font-size: 1.5rem; margin-bottom: var(--fx-space-3); }
h3 { font-size: 1.25rem; margin-bottom: var(--fx-space-2); }
h4 { font-size: 1.1rem; margin-bottom: var(--fx-space-2); }

p {
  margin-bottom: var(--fx-space-4);
  color: var(--fx-text-secondary);
}


/* --- Layout --- */
.fx-container {
  width: 100%;
  max-width: var(--fx-max-width);
  margin: 0 auto;
  padding: var(--fx-space-4);
}

.fx-container--wide {
  max-width: var(--fx-max-width-wide);
}

.fx-section {
  margin-bottom: var(--fx-space-12);
}

.fx-section__title {
  font-size: 1.5rem;
  margin-bottom: var(--fx-space-6);
  padding-bottom: var(--fx-space-3);
  border-bottom: 2px solid var(--fx-blue-100);
}


/* --- Card / Panel --- */
.fx-card {
  background: var(--fx-white);
  border: 1px solid var(--fx-border);
  border-radius: var(--fx-radius-lg);
  padding: var(--fx-space-6);
  box-shadow: var(--fx-shadow);
}

.fx-card--hero {
  border: none;
  background: linear-gradient(135deg, var(--fx-blue-50) 0%, var(--fx-white) 100%);
  border: 1px solid var(--fx-blue-100);
  box-shadow: var(--fx-shadow-md);
}

.fx-card__header {
  margin-bottom: var(--fx-space-6);
}

.fx-card__title {
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: var(--fx-space-2);
}


/* --- Form Controls --- */
.fx-form-group {
  margin-bottom: var(--fx-space-4);
}

.fx-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--fx-gray-700);
  margin-bottom: var(--fx-space-1);
}

.fx-label__hint {
  font-weight: 400;
  color: var(--fx-text-muted);
  font-size: 0.8rem;
}

.fx-input,
.fx-select {
  width: 100%;
  padding: var(--fx-space-3) var(--fx-space-4);
  font-size: 1rem;
  font-family: var(--fx-font);
  color: var(--fx-text);
  background: var(--fx-white);
  border: 1px solid var(--fx-gray-300);
  border-radius: var(--fx-radius);
  transition: border-color var(--fx-transition), box-shadow var(--fx-transition);
  appearance: none;
}

.fx-input:focus,
.fx-select:focus {
  outline: none;
  border-color: var(--fx-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.fx-input--error {
  border-color: var(--fx-error);
}
.fx-input--error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.fx-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8.825a.5.5 0 0 1-.354-.146l-4-4a.5.5 0 1 1 .708-.708L6 7.617l3.646-3.646a.5.5 0 1 1 .708.708l-4 4A.5.5 0 0 1 6 8.825z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 2.5rem;
}

.fx-input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--fx-space-4);
}

.fx-input-group {
  position: relative;
}

.fx-input-group__addon {
  position: absolute;
  right: 1px;
  top: 1px;
  bottom: 1px;
  display: flex;
  align-items: center;
  padding: 0 var(--fx-space-3);
  background: var(--fx-gray-100);
  border-left: 1px solid var(--fx-gray-300);
  border-radius: 0 var(--fx-radius) var(--fx-radius) 0;
  color: var(--fx-text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  pointer-events: none;
}


/* --- Buttons --- */
.fx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--fx-space-2);
  padding: var(--fx-space-3) var(--fx-space-6);
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--fx-font);
  border: none;
  border-radius: var(--fx-radius);
  cursor: pointer;
  transition: background var(--fx-transition), transform var(--fx-transition), box-shadow var(--fx-transition);
  white-space: nowrap;
}

.fx-btn:active {
  transform: scale(0.98);
}

.fx-btn--primary {
  color: var(--fx-white);
  background: var(--fx-primary);
  box-shadow: var(--fx-shadow-sm);
}
.fx-btn--primary:hover {
  background: var(--fx-primary-hover);
  box-shadow: var(--fx-shadow);
}

.fx-btn--secondary {
  color: var(--fx-primary);
  background: var(--fx-blue-50);
  border: 1px solid var(--fx-blue-100);
}
.fx-btn--secondary:hover {
  background: var(--fx-blue-100);
}

.fx-btn--success {
  color: var(--fx-white);
  background: var(--fx-green-600);
}
.fx-btn--success:hover {
  background: #047857;
}

.fx-btn--full {
  width: 100%;
}

.fx-btn--lg {
  padding: var(--fx-space-4) var(--fx-space-8);
  font-size: 1.1rem;
}

.fx-btn--sm {
  padding: var(--fx-space-2) var(--fx-space-4);
  font-size: 0.875rem;
}


/* --- Result Cards --- */
.fx-results {
  display: grid;
  gap: var(--fx-space-4);
  margin-top: var(--fx-space-6);
}

.fx-result-card {
  background: var(--fx-gray-50);
  border: 1px solid var(--fx-border);
  border-radius: var(--fx-radius);
  padding: var(--fx-space-4) var(--fx-space-5);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fx-result-card--highlight {
  background: var(--fx-blue-50);
  border-color: var(--fx-blue-400);
  border-width: 2px;
}

.fx-result-card--profit {
  background: var(--fx-green-50);
  border-color: var(--fx-green-500);
}

.fx-result-card--loss {
  background: var(--fx-red-50);
  border-color: var(--fx-red-500);
}

.fx-result-card__label {
  font-size: 0.875rem;
  color: var(--fx-text-secondary);
  font-weight: 500;
}

.fx-result-card__value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--fx-gray-900);
  font-family: var(--fx-font-mono);
}

.fx-result-card__value--profit {
  color: var(--fx-green-600);
}

.fx-result-card__value--loss {
  color: var(--fx-red-600);
}

.fx-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--fx-space-4);
  margin-top: var(--fx-space-6);
}


/* --- Info Box --- */
.fx-info-box {
  padding: var(--fx-space-4) var(--fx-space-5);
  border-radius: var(--fx-radius);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: var(--fx-space-4);
}

.fx-info-box--tip {
  background: var(--fx-blue-50);
  border-left: 4px solid var(--fx-blue-400);
  color: var(--fx-blue-800);
}

.fx-info-box--warning {
  background: var(--fx-amber-100);
  border-left: 4px solid var(--fx-amber-500);
  color: #92400e;
}

.fx-info-box--success {
  background: var(--fx-green-50);
  border-left: 4px solid var(--fx-green-500);
  color: #065f46;
}

.fx-info-box--error {
  background: var(--fx-red-50);
  border-left: 4px solid var(--fx-red-500);
  color: #991b1b;
}

.fx-info-box__title {
  font-weight: 700;
  margin-bottom: var(--fx-space-1);
}


/* --- Toast Notifications --- */
.fx-toast {
  position: fixed;
  top: var(--fx-space-4);
  right: var(--fx-space-4);
  padding: var(--fx-space-3) var(--fx-space-5);
  border-radius: var(--fx-radius);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fx-white);
  box-shadow: var(--fx-shadow-lg);
  z-index: 9999;
  transform: translateX(120%);
  transition: transform 300ms ease;
}

.fx-toast--visible {
  transform: translateX(0);
}

.fx-toast--success {
  background: var(--fx-green-600);
}

.fx-toast--error {
  background: var(--fx-red-600);
}


/* --- FAQ Accordion --- */
.fx-faq-list {
  list-style: none;
}

.fx-faq-item {
  border: 1px solid var(--fx-border);
  border-radius: var(--fx-radius);
  margin-bottom: var(--fx-space-3);
  overflow: hidden;
}

.fx-faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--fx-space-4) var(--fx-space-5);
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--fx-font);
  color: var(--fx-text);
  background: var(--fx-gray-50);
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background var(--fx-transition);
}

.fx-faq-question:hover {
  background: var(--fx-gray-100);
}

.fx-faq-question::after {
  content: '+';
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--fx-text-muted);
  transition: transform var(--fx-transition);
  flex-shrink: 0;
  margin-left: var(--fx-space-4);
}

.fx-faq-item--open .fx-faq-question::after {
  content: '\2212';
}

.fx-faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 300ms ease;
}

.fx-faq-answer__inner {
  padding: var(--fx-space-4) var(--fx-space-5);
  color: var(--fx-text-secondary);
  line-height: 1.7;
}

.fx-faq-item--open .fx-faq-answer {
  max-height: 500px;
}


/* --- Broker CTA --- */
.fx-cta {
  background: linear-gradient(135deg, var(--fx-blue-900) 0%, var(--fx-blue-700) 100%);
  color: var(--fx-white);
  border-radius: var(--fx-radius-lg);
  padding: var(--fx-space-6);
  text-align: center;
  margin: var(--fx-space-8) 0;
}

.fx-cta__badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  padding: var(--fx-space-1) var(--fx-space-3);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--fx-space-3);
}

.fx-cta__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--fx-white);
  margin-bottom: var(--fx-space-2);
}

.fx-cta__text {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  margin-bottom: var(--fx-space-4);
}

.fx-cta__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--fx-space-2);
  padding: var(--fx-space-3) var(--fx-space-8);
  background: var(--fx-green-500);
  color: var(--fx-white);
  font-weight: 700;
  font-size: 1rem;
  border: none;
  border-radius: var(--fx-radius);
  cursor: pointer;
  transition: background var(--fx-transition), transform var(--fx-transition);
  text-decoration: none;
}

.fx-cta__btn:hover {
  background: var(--fx-green-600);
  transform: translateY(-1px);
  text-decoration: none;
}

.fx-cta__disclaimer {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: var(--fx-space-3);
}


/* --- Related Tools --- */
.fx-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--fx-space-4);
}

.fx-related-link {
  display: flex;
  align-items: center;
  gap: var(--fx-space-3);
  padding: var(--fx-space-4);
  background: var(--fx-white);
  border: 1px solid var(--fx-border);
  border-radius: var(--fx-radius);
  color: var(--fx-text);
  font-weight: 500;
  transition: border-color var(--fx-transition), box-shadow var(--fx-transition);
  text-decoration: none;
}

.fx-related-link:hover {
  border-color: var(--fx-primary);
  box-shadow: var(--fx-shadow-md);
  text-decoration: none;
}

.fx-related-link__icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}


/* --- Formula / Code Display --- */
.fx-formula {
  background: var(--fx-gray-900);
  color: #e2e8f0;
  padding: var(--fx-space-5);
  border-radius: var(--fx-radius);
  font-family: var(--fx-font-mono);
  font-size: 0.9rem;
  line-height: 1.8;
  overflow-x: auto;
  margin-bottom: var(--fx-space-4);
}

.fx-formula var {
  color: var(--fx-blue-400);
  font-style: normal;
}


/* --- Steps / How-to --- */
.fx-steps {
  counter-reset: step;
  list-style: none;
}

.fx-step {
  display: flex;
  gap: var(--fx-space-4);
  margin-bottom: var(--fx-space-5);
  position: relative;
}

.fx-step::before {
  counter-increment: step;
  content: counter(step);
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--fx-primary);
  color: var(--fx-white);
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: 50%;
}

.fx-step__content h4 {
  margin-bottom: var(--fx-space-1);
}

.fx-step__content p {
  font-size: 0.9rem;
}


/* --- Table --- */
.fx-table-wrap {
  overflow-x: auto;
  margin-bottom: var(--fx-space-6);
}

.fx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.fx-table th,
.fx-table td {
  padding: var(--fx-space-3) var(--fx-space-4);
  text-align: left;
  border-bottom: 1px solid var(--fx-border);
}

.fx-table th {
  background: var(--fx-gray-50);
  font-weight: 600;
  color: var(--fx-gray-700);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fx-table tr:hover td {
  background: var(--fx-gray-50);
}


/* --- Tooltips --- */
.fx-tooltip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--fx-space-1);
}

.fx-tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--fx-gray-300);
  color: var(--fx-white);
  font-size: 0.65rem;
  font-weight: 700;
  cursor: help;
  flex-shrink: 0;
  line-height: 1;
}

.fx-tooltip-icon::after {
  content: '?';
}

.fx-tooltip-bubble {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--fx-gray-900);
  color: var(--fx-white);
  padding: var(--fx-space-2) var(--fx-space-3);
  border-radius: var(--fx-radius-sm);
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.5;
  white-space: normal;
  width: max-content;
  max-width: 260px;
  z-index: 100;
  box-shadow: var(--fx-shadow-lg);
  pointer-events: none;
}

.fx-tooltip-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--fx-gray-900);
}

.fx-tooltip-wrap:hover .fx-tooltip-bubble,
.fx-tooltip-icon:focus + .fx-tooltip-bubble {
  display: block;
}


/* --- Action Bar (copy / reset row) --- */
.fx-action-bar {
  display: flex;
  gap: var(--fx-space-3);
  margin-top: var(--fx-space-4);
  flex-wrap: wrap;
}


/* --- Broker Comparison Cards --- */
.fx-broker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--fx-space-4);
}

.fx-broker-card {
  background: var(--fx-white);
  border: 1px solid var(--fx-border);
  border-radius: var(--fx-radius-lg);
  padding: var(--fx-space-5);
  text-align: center;
  transition: box-shadow var(--fx-transition), border-color var(--fx-transition);
}

.fx-broker-card:hover {
  border-color: var(--fx-blue-400);
  box-shadow: var(--fx-shadow-md);
}

.fx-broker-card__name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--fx-gray-900);
  margin-bottom: var(--fx-space-2);
}

.fx-broker-card__feature {
  font-size: 0.85rem;
  color: var(--fx-text-secondary);
  margin-bottom: var(--fx-space-1);
}

.fx-broker-card__cta {
  display: inline-block;
  margin-top: var(--fx-space-4);
  padding: var(--fx-space-2) var(--fx-space-6);
  background: var(--fx-primary);
  color: var(--fx-white);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--fx-radius);
  text-decoration: none;
  transition: background var(--fx-transition);
}

.fx-broker-card__cta:hover {
  background: var(--fx-primary-hover);
  text-decoration: none;
}


/* --- Conversion Note --- */
.fx-conversion-note {
  display: flex;
  align-items: flex-start;
  gap: var(--fx-space-3);
  padding: var(--fx-space-3) var(--fx-space-4);
  background: var(--fx-amber-100);
  border-radius: var(--fx-radius);
  font-size: 0.8rem;
  color: #92400e;
  margin-top: var(--fx-space-3);
}


/* --- Radio Button Group (pill toggle) --- */
.fx-radio-group {
  display: flex;
  gap: 0;
  border: 1px solid var(--fx-gray-300);
  border-radius: var(--fx-radius);
  overflow: hidden;
}

.fx-radio-group input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.fx-radio-group label {
  flex: 1;
  padding: var(--fx-space-3) var(--fx-space-4);
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--fx-transition), color var(--fx-transition);
  color: var(--fx-text-secondary);
  background: var(--fx-white);
  border-right: 1px solid var(--fx-gray-300);
  user-select: none;
}

.fx-radio-group label:last-of-type {
  border-right: none;
}

.fx-radio-group input[type="radio"]:checked + label {
  background: var(--fx-primary);
  color: var(--fx-white);
}

.fx-radio-group--buy-sell input[value="buy"]:checked + label {
  background: var(--fx-green-600);
}

.fx-radio-group--buy-sell input[value="sell"]:checked + label {
  background: var(--fx-red-600);
}


/* --- Trade Direction Indicator --- */
.fx-direction-indicator {
  display: inline-flex;
  align-items: center;
  gap: var(--fx-space-2);
  font-weight: 700;
  font-size: 1.1rem;
}

.fx-direction-indicator--profit { color: var(--fx-green-600); }
.fx-direction-indicator--loss { color: var(--fx-red-600); }

.fx-direction-indicator__arrow {
  font-size: 1.3rem;
  line-height: 1;
}


/* --- Trade Log (localStorage) --- */
.fx-trade-log {
  margin-top: var(--fx-space-6);
}

.fx-trade-log__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--fx-space-3);
}

.fx-trade-log__header h3 {
  font-size: 1rem;
  margin-bottom: 0;
}

.fx-trade-log__empty {
  text-align: center;
  color: var(--fx-text-muted);
  font-size: 0.85rem;
  padding: var(--fx-space-6) 0;
}

.fx-trade-log-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--fx-space-3) var(--fx-space-4);
  border: 1px solid var(--fx-border);
  border-radius: var(--fx-radius-sm);
  margin-bottom: var(--fx-space-2);
  font-size: 0.85rem;
}

.fx-trade-log-item__info {
  display: flex;
  gap: var(--fx-space-4);
  flex-wrap: wrap;
}

.fx-trade-log-item__pair {
  font-weight: 600;
}

.fx-trade-log-item__pnl {
  font-weight: 700;
  font-family: var(--fx-font-mono);
}

.fx-trade-log-item__delete {
  background: none;
  border: none;
  color: var(--fx-text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0 var(--fx-space-2);
  transition: color var(--fx-transition);
}

.fx-trade-log-item__delete:hover {
  color: var(--fx-red-500);
}


/* --- Input Mode Toggle (tabs) --- */
.fx-tab-toggle {
  display: flex;
  border-bottom: 2px solid var(--fx-gray-200);
  margin-bottom: var(--fx-space-4);
}

.fx-tab-toggle__btn {
  padding: var(--fx-space-2) var(--fx-space-5);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--fx-font);
  color: var(--fx-text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color var(--fx-transition), border-color var(--fx-transition);
}

.fx-tab-toggle__btn:hover {
  color: var(--fx-text);
}

.fx-tab-toggle__btn--active {
  color: var(--fx-primary);
  border-bottom-color: var(--fx-primary);
}


/* --- Utility Classes --- */
.fx-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.fx-text-center { text-align: center; }
.fx-text-mono { font-family: var(--fx-font-mono); }
.fx-mt-0 { margin-top: 0; }
.fx-mb-0 { margin-bottom: 0; }


/* --- Responsive --- */
@media (max-width: 640px) {
  :root {
    --fx-max-width: 100%;
  }

  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }

  .fx-input-row {
    grid-template-columns: 1fr;
  }

  .fx-result-card {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--fx-space-1);
  }

  .fx-result-card__value {
    font-size: 1.1rem;
  }

  .fx-result-grid {
    grid-template-columns: 1fr;
  }

  .fx-related-grid {
    grid-template-columns: 1fr;
  }

  .fx-cta {
    padding: var(--fx-space-5);
  }

  .fx-card {
    padding: var(--fx-space-4);
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .fx-result-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
