/* ═══════════════════════════════════════════════════════════
   احسبلي — Enhanced UI Styles
   Premium UX Components: Results, Actions, Status, Mobile
   ═══════════════════════════════════════════════════════════ */

/* ── Legacy Compatibility: Missing Design Tokens ── */
/* --bg-card is referenced by many tool pages but was never defined.
   NOTE: --bg is already defined in style.css per theme; do not override. */
:root { --bg-card: var(--surface-2, #eaf0f8); }
[data-theme="dark"] { --bg-card: #1e293b; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg-card: #1e293b; }
}

/* ── Legacy Compatibility: Missing Class Aliases ── */
/* Many newer calculator pages use these classes that were never defined */
.calc-card {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  padding: 32px 28px;
  margin: 24px auto;
  max-width: 820px;
}
@media (max-width: 600px) {
  .calc-card { padding: 22px 18px; border-radius: 14px; margin: 16px auto; }
}
.calc-card .tool-header {
  text-align: center;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border, #e2e8f0);
}
.calc-card .tool-header h1 {
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--primary, #1a5276);
  margin: 8px 0;
  line-height: 1.3;
}
.calc-card .tool-header p {
  font-size: 0.95rem;
  color: var(--text-muted, #64748b);
  margin: 0;
  line-height: 1.6;
}
@media (max-width: 600px) {
  .calc-card .tool-header h1 { font-size: 1.4rem; }
  .calc-card .tool-header p { font-size: 0.88rem; }
}

/* ── Consistent vertical spacing between sections ── */
.calc-card + .ad-slot,
.calc-card + section,
.calc-card + article,
.faq-section + article,
.faq-section + section,
.faq-section + .content-section,
.ad-slot + section,
.ad-slot + .faq-section,
.ad-slot + .content-section,
.ad-slot + article {
  margin-top: 24px;
}
.faq-section { margin-bottom: 24px; }

/* Constrain content sections to same readable width */
.container > .faq-section,
.container > article.content-section,
.container > section.content-section {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Breadcrumb spacing ── */
.container > .breadcrumb,
.container > .ad-slot + .breadcrumb {
  max-width: 820px;
  margin: 14px auto 10px;
  font-size: 0.88rem;
  color: var(--text-muted, #64748b);
  padding: 0 4px;
}
.container > .breadcrumb a {
  color: var(--primary, #1a5276);
  text-decoration: none;
  font-weight: 600;
}
.container > .breadcrumb a:hover { text-decoration: underline; }
.container > .breadcrumb span {
  margin: 0 6px;
  color: var(--text-muted, #64748b);
}
.tool-icon-large {
  display: block;
  font-size: 3rem;
  text-align: center;
  margin-bottom: 10px;
}
.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text, #0f172a);
  margin: 12px 0 6px;
}
/* Higher specificity (element.class) to override .form-group input from style.css */
input.form-input,
select.form-input,
textarea.form-input {
  display: block;
  width: 100%;
  padding: 13px 16px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  border: 2px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: var(--surface, #fff);
  color: var(--text, #0f172a);
  direction: rtl;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  box-sizing: border-box;
}
input.form-input:hover,
select.form-input:hover,
textarea.form-input:hover {
  border-color: #cbd5e1;
}
input.form-input:focus,
select.form-input:focus,
textarea.form-input:focus {
  border-color: var(--primary, #1a5276);
  box-shadow: 0 0 0 4px rgba(26, 82, 118, 0.14);
  background: var(--surface, #fff);
}
select.form-input {
  appearance: none;
  -webkit-appearance: none;
  padding-left: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  cursor: pointer;
}
.result-area {
  margin-top: 20px;
  padding: 0;
  display: none;
}
.result-area.show {
  display: block;
  animation: fadeIn 0.4s ease;
}
[data-theme="dark"] .calc-card {
  background: #1e293b;
  border-color: #334155;
}
[data-theme="dark"] input.form-input,
[data-theme="dark"] select.form-input,
[data-theme="dark"] textarea.form-input {
  background: #0f172a;
  color: #e2e8f0;
  border-color: #334155;
}
[data-theme="dark"] input.form-input:hover,
[data-theme="dark"] select.form-input:hover {
  border-color: #475569;
}
[data-theme="dark"] input.form-input:focus,
[data-theme="dark"] select.form-input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.2);
}
[data-theme="dark"] select.form-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

/* ── Legacy: #site-footer placeholder should be visible ── */
#site-footer { display: block; }

/* ── Section title used by newer tools ── */
.section-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary, #1a5276);
  margin-bottom: 14px;
}

/* ── FAQ button variant used by newer tools ── */
button.faq-q {
  width: 100%;
  background: transparent;
  border: none;
  padding: 18px 4px;
  text-align: right;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary, #1a5276);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  line-height: 1.6;
  direction: rtl;
  transition: color 0.2s;
}
button.faq-q:hover { color: var(--accent, #f39c12); }
button.faq-q:focus-visible {
  outline: 2px solid var(--primary, #1a5276);
  outline-offset: 2px;
  border-radius: 8px;
}
button.faq-q .faq-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2, #eaf0f8);
  color: var(--primary, #1a5276);
  border-radius: 50%;
  font-size: 1.3rem;
  font-weight: 700;
  transition: all 0.2s;
}
button.faq-q:hover .faq-icon {
  background: var(--accent, #f39c12);
  color: #fff;
}

/* ── FAQ section improvements (used by newer tools) ── */
.faq-section {
  background: var(--surface, #fff) !important;
  border-radius: 18px !important;
  padding: 28px 24px !important;
  margin: 24px auto !important;
  max-width: 820px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05) !important;
  border: 1px solid var(--border, #e2e8f0);
}
.faq-section > h2,
.faq-section > .section-title {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--primary, #1a5276);
  margin: 0 0 18px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--surface-2, #eaf0f8);
}
/* Item spacing when using .faq-item + button.faq-q pattern */
.faq-section .faq-item {
  border-top: 1px solid var(--border, #e2e8f0);
  padding: 0;
}
.faq-section .faq-item:first-of-type { border-top: none; }
.faq-section .faq-item .faq-a {
  padding: 0 4px 16px;
  color: var(--text-muted, #64748b);
  line-height: 1.8;
  font-size: 0.92rem;
  display: none;
}
.faq-section .faq-item .faq-a.open { display: block; animation: fadeIn 0.3s ease; }
.faq-section .faq-item .faq-a span { display: block; }

@media (max-width: 600px) {
  .faq-section { padding: 20px 16px !important; }
  .faq-section > h2, .faq-section > .section-title { font-size: 1.1rem; }
  button.faq-q { font-size: 0.95rem; padding: 16px 4px; }
}

[data-theme="dark"] .faq-section {
  background: #1e293b !important;
  border-color: #334155;
}
[data-theme="dark"] .faq-section > h2,
[data-theme="dark"] .faq-section > .section-title {
  border-bottom-color: #334155;
}
[data-theme="dark"] .faq-section .faq-item {
  border-top-color: #334155;
}
[data-theme="dark"] button.faq-q .faq-icon {
  background: #334155;
  color: #93c5fd;
}

/* ── Enhanced Results Grid ── */
.results-grid.enhanced {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.results-grid.enhanced .result-item {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  position: relative;
}

.results-grid.enhanced .result-item.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.result-item .r-tooltip {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
  opacity: 0.7;
}

.result-item.highlight .r-tooltip {
  color: rgba(255, 255, 255, 0.6);
}

/* Counter animation for numbers */
.result-item .r-value {
  font-variant-numeric: tabular-nums;
}

/* ── Result Actions (Copy / Share) ── */
.result-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: 2px solid var(--border);
  border-radius: 50px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.action-btn:hover {
  border-color: var(--primary);
  background: var(--surface-2);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26, 82, 118, 0.1);
}

.action-btn.feedback {
  border-color: var(--success);
  color: var(--success);
  background: rgba(39, 174, 96, 0.05);
}

.action-icon {
  font-size: 1rem;
}

/* ── Explanation Section ── */
.result-explanation {
  margin-top: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}

.explanation-toggle {
  width: 100%;
  padding: 14px 18px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}

.explanation-toggle:hover {
  background: var(--surface-2);
}

.toggle-icon {
  transition: transform 0.3s ease;
  font-size: 0.8rem;
}

.result-explanation.open .toggle-icon {
  transform: rotate(180deg);
}

.explanation-content {
  display: none;
  padding: 0 18px 18px;
}

.result-explanation.open .explanation-content {
  display: block;
  animation: fadeSlideDown 0.3s ease;
}

@keyframes fadeSlideDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.explanation-content ul {
  list-style: none;
  padding: 0;
}

.explanation-content li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.8;
  padding-right: 16px;
  position: relative;
}

.explanation-content li::before {
  content: '•';
  position: absolute;
  right: 0;
  color: var(--primary);
  font-weight: bold;
}

.explanation-content li:last-child {
  border-bottom: none;
}

/* ── Sources Section ── */
.result-sources {
  margin-top: 16px;
  padding: 14px 18px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border-right: 3px solid var(--primary);
}

.sources-header {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.result-sources ul {
  list-style: none;
  padding: 0;
}

.result-sources li {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.result-sources li::before {
  content: '📎';
  font-size: 0.7rem;
}

.result-sources a {
  color: var(--primary);
  text-decoration: none;
}

.result-sources a:hover {
  text-decoration: underline;
}

.source-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.7;
}

/* ── Recommendations ── */
.result-recommendations {
  margin-top: 20px;
}

.recs-header {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
}

.recs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.rec-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  transition: all 0.25s ease;
  font-size: 0.88rem;
}

.rec-card:hover {
  border-color: var(--accent);
  background: rgba(243, 156, 18, 0.04);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(243, 156, 18, 0.12);
}

.rec-card.rec-info {
  border-color: rgba(36, 113, 163, 0.2);
  background: rgba(36, 113, 163, 0.03);
  cursor: default;
}

.rec-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.rec-text {
  flex: 1;
  font-weight: 600;
  line-height: 1.4;
  font-size: 0.84rem;
}

.rec-arrow {
  color: var(--accent);
  font-weight: bold;
  font-size: 1rem;
  transition: transform 0.2s;
}

.rec-card:hover .rec-arrow {
  transform: translateX(-4px);
}

/* ── Data Status Indicator ── */
.data-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
}

.status-fresh {
  background: rgba(39, 174, 96, 0.08);
  color: var(--success);
  border: 1px solid rgba(39, 174, 96, 0.15);
}

.status-stale {
  background: rgba(243, 156, 18, 0.08);
  color: var(--accent-hover);
  border: 1px solid rgba(243, 156, 18, 0.15);
}

.status-icon {
  font-size: 0.9rem;
}

/* ── Input Validation ── */
.form-group.has-error input,
.form-group.has-error select {
  border-color: var(--error) !important;
  background: rgba(231, 76, 60, 0.03);
}

.input-error {
  font-size: 0.78rem;
  color: var(--error);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.input-error::before {
  content: '⚠️';
  font-size: 0.7rem;
}

/* ── Result Errors ── */
.result-errors {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.error-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(231, 76, 60, 0.05);
  border: 1px solid rgba(231, 76, 60, 0.15);
  border-radius: var(--radius-sm);
  border-right: 4px solid var(--error);
  color: var(--error);
  font-size: 0.9rem;
  font-weight: 600;
}

/* ── Sticky Mobile Result Bar ── */
.sticky-result-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(12px);
}
.sticky-result-bar ~ *,
.sticky-result-bar + * { /* prevent content hiding behind bar */ }
body:has(.sticky-result-bar) .site-footer { padding-bottom: 60px; }
body:has(.sticky-result-bar) .scroll-top-btn { bottom: 72px; }

.sticky-result-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sticky-label {
  font-size: 0.82rem;
  opacity: 0.8;
}

.sticky-value {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--accent);
}

.sticky-scroll-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 50px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.sticky-scroll-btn:hover {
  background: var(--accent-hover);
}

/* ── Tooltip ── */
.ahsebli-tooltip {
  position: fixed;
  display: none;
  background: var(--text);
  color: var(--surface);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  max-width: 280px;
  z-index: 10000;
  transform: translateX(-50%);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  line-height: 1.5;
}

.ahsebli-tooltip::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: var(--text);
}

/* ── Mobile Responsive ── */
@media (max-width: 768px) {
  .result-actions {
    flex-direction: column;
  }

  .action-btn {
    justify-content: center;
  }

  .recs-grid {
    grid-template-columns: 1fr;
  }

  .results-grid.enhanced {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) {
  .sticky-result-bar {
    display: none !important;
  }
}

/* ── Sprint 7: Internal Linking Component ── */
.internal-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.internal-link-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  transition: all 0.25s ease;
}

.internal-link-card:hover {
  border-color: var(--primary);
  background: var(--surface-2);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(26, 82, 118, 0.08);
}

.il-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.il-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.il-text strong {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.3;
}

.il-text small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Sprint 7: Data Status in Widget Header ── */
#dataStatus {
  margin-top: 8px;
}

@media (max-width: 768px) {
  .internal-links-grid {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════
   CURRENCY CONVERTER — Professional UI
   ═══════════════════════════════════════════════ */

.currency-pair-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.currency-select-group,
.currency-select-wrap {
  flex: 1;
}

.currency-select-group label,
.currency-select-wrap label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.currency-select-group select,
.currency-select-wrap select {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s;
  min-height: 48px;
}

.currency-select-group select:focus,
.currency-select-wrap select:focus {
  border-color: var(--primary);
  outline: none;
}

.swap-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
  margin-top: 20px;
}

.swap-btn:hover {
  transform: rotate(180deg);
  border-color: var(--primary);
  background: var(--surface-2);
}

.live-rate-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(26, 82, 118, 0.04), rgba(39, 174, 96, 0.04));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.live-rate-value {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--primary);
}

.rate-trend-up { color: var(--success); font-weight: 700; }
.rate-trend-down { color: var(--error); font-weight: 700; }
.rate-trend-stable { color: var(--text-muted); }

.last-updated-live {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.currency-result-big {
  text-align: center;
  padding: 24px 16px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  border-radius: var(--radius);
  color: #fff;
  margin-bottom: 20px;
}

.currency-result-big .result-from {
  font-size: 1rem;
  opacity: 0.85;
  margin-bottom: 8px;
}

.currency-result-big .result-to {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 8px;
}

.currency-result-big .result-rate {
  font-size: 0.88rem;
  opacity: 0.7;
}

/* Table scroll wrapper for mobile */
.service-comparison-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.service-comparison-table-wrap .service-comparison-table {
  min-width: 420px;
}

.service-comparison { margin-top: 20px; }

.service-comparison h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
}

.service-comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.service-comparison-table th {
  padding: 10px 12px;
  text-align: right;
  background: var(--surface-2);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.82rem;
  border-bottom: 2px solid var(--border);
}

.service-comparison-table td {
  padding: 12px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.service-comparison-table tbody tr:first-child {
  background: rgba(39, 174, 96, 0.04);
}

.service-comparison-table tbody tr:first-child td:first-child::after {
  content: ' (الأفضل)';
  color: #27ae60;
  font-size: 0.75rem;
  font-weight: 700;
}

.service-comparison-table tbody tr:hover { background: var(--surface-2); }

.svc-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.svc-icon { font-size: 1.2rem; }
.svc-speed { font-size: 0.75rem; color: var(--text-muted); display: block; }
.svc-net { font-weight: 900; color: var(--primary); }

.svc-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: center;
}

.currency-amount-input input {
  width: 100%;
  padding: 14px 16px;
  font-size: 1.2rem;
  font-weight: 700;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  transition: border-color 0.2s;
}

.currency-amount-input input:focus {
  border-color: var(--primary);
  outline: none;
}

@media (max-width: 768px) {
  .currency-pair-row { flex-direction: column; }
  .swap-btn { margin-top: 0; transform: rotate(90deg); }
  .swap-btn:hover { transform: rotate(270deg); }
  .currency-result-big .result-to { font-size: 1.6rem; }
  .service-comparison-table { font-size: 0.8rem; }
  .service-comparison-table th,
  .service-comparison-table td { padding: 8px 6px; }
}

/* ═══════════════════════════════════════════════
   GOLD LIVE BANNER — Above-fold price display
   ═══════════════════════════════════════════════ */

.gold-live-banner {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 2px solid #f59e0b;
  border-radius: var(--radius, 12px);
  padding: 20px 24px;
  margin-bottom: 20px;
}

[data-theme="dark"] .gold-live-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(245, 158, 11, 0.04) 100%);
  border-color: rgba(245, 158, 11, 0.3);
}

.gold-banner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.gold-banner-header h2 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #92400e;
  margin: 0;
}

[data-theme="dark"] .gold-banner-header h2 {
  color: #fbbf24;
}

.gold-banner-status {
  font-size: 0.78rem;
  font-weight: 600;
  color: #a16207;
  background: rgba(245, 158, 11, 0.15);
  padding: 4px 12px;
  border-radius: 50px;
}

.gold-banner-status.live {
  color: #15803d;
  background: rgba(34, 197, 94, 0.12);
}

.gold-banner-status.stale {
  color: #a16207;
  background: rgba(245, 158, 11, 0.15);
}

.gold-banner-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.gold-karat-card {
  background: #fff;
  border-radius: 10px;
  padding: 16px 12px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(146, 64, 14, 0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

[data-theme="dark"] .gold-karat-card {
  background: var(--surface, #1e293b);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.gold-karat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(146, 64, 14, 0.15);
}

.karat-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: #a16207;
  margin-bottom: 6px;
}

[data-theme="dark"] .karat-label {
  color: #fbbf24;
}

.karat-price {
  display: block;
  font-size: 1.6rem;
  font-weight: 900;
  color: #92400e;
  line-height: 1.2;
  direction: ltr;
}

[data-theme="dark"] .karat-price {
  color: #fde68a;
}

.karat-unit {
  display: block;
  font-size: 0.72rem;
  color: #a16207;
  margin-top: 4px;
}

[data-theme="dark"] .karat-unit {
  color: #d97706;
}

@media (max-width: 768px) {
  .gold-banner-grid {
    gap: 8px;
  }
  .gold-karat-card {
    padding: 14px 8px;
  }
  .karat-price {
    font-size: 1.3rem;
    overflow-wrap: break-word;
  }
}

@media (max-width: 480px) {
  .gold-live-banner {
    padding: 14px 16px;
  }
  .gold-banner-header h2 {
    font-size: 0.92rem;
  }
  .gold-banner-grid {
    gap: 6px;
  }
  .gold-karat-card {
    padding: 10px 6px;
  }
  .karat-price {
    font-size: 1.1rem;
  }
}

/* ═══════════════════════════════════════════════
   QUICK LOAN ESTIMATE — Category above-fold
   ═══════════════════════════════════════════════ */

.quick-estimate-banner {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 2px solid #3b82f6;
  border-radius: var(--radius, 12px);
  padding: 20px 24px;
  margin-bottom: 20px;
}

[data-theme="dark"] .quick-estimate-banner {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(59, 130, 246, 0.04) 100%);
  border-color: rgba(59, 130, 246, 0.3);
}

.quick-estimate-banner h2 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #1e40af;
  margin: 0 0 14px 0;
}

[data-theme="dark"] .quick-estimate-banner h2 {
  color: #60a5fa;
}

.quick-estimate-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}

.quick-estimate-form .qe-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #1e40af;
  margin-bottom: 6px;
}

[data-theme="dark"] .quick-estimate-form .qe-group label {
  color: #93bbfd;
}

.quick-estimate-form input,
.quick-estimate-form select {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #bfdbfe;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  background: #fff;
  color: var(--text, #1e293b);
  box-sizing: border-box;
}

[data-theme="dark"] .quick-estimate-form input,
[data-theme="dark"] .quick-estimate-form select {
  background: var(--surface, #1e293b);
  border-color: rgba(59, 130, 246, 0.3);
}

.quick-estimate-form input:focus,
.quick-estimate-form select:focus {
  border-color: #3b82f6;
  outline: none;
}

.qe-btn {
  padding: 10px 20px;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.qe-btn:hover {
  background: #2563eb;
}

.qe-result {
  margin-top: 14px;
  padding: 14px 18px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(30, 64, 175, 0.08);
  display: none;
  text-align: center;
}

[data-theme="dark"] .qe-result {
  background: var(--surface, #1e293b);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.qe-result.show { display: block; }

.qe-result-value {
  font-size: 1.6rem;
  font-weight: 900;
  color: #1e40af;
}

[data-theme="dark"] .qe-result-value {
  color: #60a5fa;
}

.qe-result-label {
  font-size: 0.82rem;
  color: #6b7280;
  margin-top: 4px;
}

.qe-result-detail {
  font-size: 0.78rem;
  color: #9ca3af;
  margin-top: 8px;
}

.qe-cta {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #3b82f6;
  text-decoration: none;
}

.qe-cta:hover { text-decoration: underline; }

@media (max-width: 600px) {
  .quick-estimate-form {
    grid-template-columns: 1fr;
  }
  .quick-estimate-banner {
    padding: 14px 16px;
  }
}