
    /* ============================================================
       RESET & BASE
       ============================================================ */
    *, *::before, *::after {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      -webkit-tap-highlight-color: transparent;
    }

    /* ============================================================
       CSS VARIABLES — Central theme tokens
       ============================================================ */
    :root {
      --bg-deep:       #0a0e1a;
      --bg-mid:        #111829;
      --bg-card:       rgba(22, 30, 52, 0.72);
      --bg-input:      rgba(15, 20, 38, 0.7);
      --border-subtle: rgba(255, 255, 255, 0.07);
      --border-focus:  rgba(180, 155, 100, 0.5);

      --gold-primary:  #c9a84c;
      --gold-light:    #e2c97e;
      --gold-glow:     rgba(201, 168, 76, 0.25);

      --text-primary:  #f0edd6;
      --text-muted:    #7a8299;
      --text-dim:      #4e5672;

      --radius-sm:     8px;
      --radius-md:     14px;
      --radius-lg:     24px;
      --radius-xl:     32px;

      --shadow-card:   0 24px 60px rgba(0, 0, 0, 0.45),
                       0  4px 12px rgba(0, 0, 0, 0.2);
      --shadow-btn:    0  4px 18px rgba(201, 168, 76, 0.35);
      --shadow-input:  0  2px  8px rgba(0, 0, 0, 0.3);

      --transition:    0.28s cubic-bezier(.4, 0, .2, 1);
    }

    /* ============================================================
       BODY & LAYOUT SHELL
       ============================================================ */
    body {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
      background-color: var(--bg-deep);
      color: var(--text-primary);
      min-height: 100vh;
      min-height: -webkit-fill-available;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: clamp(16px, 4vw, 24px);
      position: relative;
      overflow-x: hidden;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
    }

    html {
      height: -webkit-fill-available;
    }

    /* ============================================================
       AMBIENT BACKGROUND ORBS
       ============================================================ */
    .bg-orb {
      position: fixed;
      border-radius: 50%;
      filter: blur(100px);
      pointer-events: none;
      z-index: 0;
      opacity: 0.35;
    }
    .bg-orb--1 {
      width: clamp(300px, 80vw, 420px);
      height: clamp(300px, 80vw, 420px);
      background: radial-gradient(circle, #1a2650 0%, transparent 70%);
      top: -120px; left: -100px;
    }
    .bg-orb--2 {
      width: clamp(250px, 70vw, 360px);
      height: clamp(250px, 70vw, 360px);
      background: radial-gradient(circle, #2a1a0a 0%, transparent 70%);
      bottom: -80px; right: -80px;
    }
    .bg-orb--3 {
      width: clamp(180px, 50vw, 240px);
      height: clamp(180px, 50vw, 240px);
      background: radial-gradient(circle, rgba(201,168,76,0.15) 0%, transparent 70%);
      top: 50%; left: 50%;
      transform: translate(-50%, -50%);
    }

    /* ============================================================
       MAIN CONTAINER
       ============================================================ */
    .container {
      position: relative;
      z-index: 1;
      width: 100%;
      max-width: 460px;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: clamp(20px, 5vw, 28px);
    }

    /* ============================================================
       HEADER — Logo + Tagline
       ============================================================ */
    .header {
      text-align: center;
      animation: fadeSlideDown 0.6s ease both;
    }
    .header__logo {
      font-size: clamp(1.8rem, 6vw, 2.6rem);
      font-weight: 700;
      letter-spacing: -0.5px;
      color: var(--text-primary);
      line-height: 1.1;
    }
    .header__logo span {
      background: linear-gradient(135deg, var(--gold-primary), var(--gold-light));
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }
    .header__tagline {
      margin-top: 6px;
      font-size: clamp(0.7rem, 2vw, 0.82rem);
      color: var(--text-muted);
      letter-spacing: clamp(1.5px, 0.5vw, 2.5px);
      text-transform: uppercase;
      font-weight: 400;
    }

    /* ============================================================
       CARD — Main converter shell
       ============================================================ */
    .card {
      width: 100%;
      background: var(--bg-card);
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
      border: 1px solid var(--border-subtle);
      border-radius: clamp(var(--radius-lg), 5vw, var(--radius-xl));
      box-shadow: var(--shadow-card);
      padding: clamp(24px, 6vw, 36px) clamp(20px, 5vw, 32px) clamp(22px, 5vw, 32px);
      display: flex;
      flex-direction: column;
      gap: clamp(18px, 4vw, 22px);
      animation: fadeSlideUp 0.55s ease 0.1s both;
      overflow: visible;
    }

    /* ============================================================
       SECTION LABEL
       ============================================================ */
    .section-label {
      font-size: clamp(0.65rem, 1.8vw, 0.7rem);
      text-transform: uppercase;
      letter-spacing: clamp(1.5px, 0.4vw, 2px);
      color: var(--text-dim);
      margin-bottom: 6px;
      font-weight: 600;
    }

    /* ============================================================
       INPUT GROUP — Amount
       ============================================================ */
    .input-group {
      display: flex;
      flex-direction: column;
      gap: 0;
    }
    .input-group input[type="number"] {
      background: var(--bg-input);
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-md);
      color: var(--text-primary);
      font-size: clamp(1.3rem, 4vw, 1.55rem);
      font-weight: 600;
      padding: clamp(12px, 3vw, 14px) clamp(14px, 3.5vw, 18px);
      outline: none;
      box-shadow: var(--shadow-input);
      transition: border-color var(--transition), box-shadow var(--transition);
      -moz-appearance: textfield;
      -webkit-appearance: none;
      width: 100%;
      touch-action: manipulation;
    }
    .input-group input[type="number"]::-webkit-outer-spin-button,
    .input-group input[type="number"]::-webkit-inner-spin-button {
      -webkit-appearance: none;
      margin: 0;
    }
    .input-group input[type="number"]::placeholder {
      color: var(--text-dim);
    }
    .input-group input[type="number"]:focus {
      border-color: var(--border-focus);
      box-shadow: 0 0 0 3px var(--gold-glow), var(--shadow-input);
    }

    /* ============================================================
       CURRENCY ROW
       ============================================================ */
    .currency-row {
      display: flex;
      align-items: flex-start;
      gap: clamp(8px, 2vw, 12px);
      width: 100%;
    }
    
    .currency-row .select-wrap {
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
    }

    .swap-wrap {
      display: flex;
      flex-direction: column;
      align-items: center;
      flex-shrink: 0;
      margin-top: clamp(20px, 5vw, 24px);
    }

    /* ============================================================
       CUSTOM SEARCHABLE DROPDOWN
       ============================================================ */
    .currency-dropdown {
      position: relative;
      width: 100%;
      z-index: 100;
    }

    .dropdown-selected {
      background: var(--bg-input);
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-md);
      padding: clamp(11px, 2.5vw, 13px) clamp(12px, 3vw, 16px);
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: clamp(8px, 2vw, 10px);
      font-size: clamp(0.85rem, 2.2vw, 0.95rem);
      transition: all var(--transition);
      touch-action: manipulation;
      min-height: 44px;
      color: var(--text-primary);
    }

    .dropdown-selected:active {
      transform: scale(0.98);
    }

    .dropdown-selected img {
      width: clamp(18px, 4vw, 20px);
      height: auto;
      border-radius: 2px;
      flex-shrink: 0;
    }

    .dropdown-panel {
      position: absolute;
      top: calc(100% + 8px);
      left: 0;
      width: 100%;
      background: var(--bg-card);
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-md);
      box-shadow: var(--shadow-card);
      display: none;
      flex-direction: column;
      z-index: 1000;
      max-height: 60vh;
    }

    .currency-dropdown.open .dropdown-panel {
      display: flex;
    }

    .dropdown-search {
      padding: clamp(10px, 2.5vw, 12px) clamp(12px, 3vw, 14px);
      background: var(--bg-input);
      border: none;
      border-bottom: 1px solid var(--border-subtle);
      color: var(--text-primary);
      outline: none;
      font-size: clamp(0.85rem, 2.2vw, 0.95rem);
      width: 100%;
      border-radius: var(--radius-md) var(--radius-md) 0 0;
      -webkit-appearance: none;
    }

    .dropdown-search:focus {
      box-shadow: inset 0 -2px 0 var(--gold-primary);
    }

    .dropdown-list {
      max-height: calc(60vh - 50px);
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      list-style: none;
    }

    .dropdown-list li {
      padding: clamp(10px, 2.5vw, 12px) clamp(12px, 3vw, 14px);
      display: flex;
      align-items: center;
      gap: clamp(8px, 2vw, 10px);
      cursor: pointer;
      font-size: clamp(0.85rem, 2.2vw, 0.95rem);
      min-height: 44px;
      transition: background var(--transition);
      touch-action: manipulation;
    }

    .dropdown-list li:active {
      background: rgba(201,168,76,0.15);
    }

    .dropdown-list li:hover {
      background: rgba(201,168,76,0.1);
    }

    .dropdown-list img {
      width: clamp(18px, 4vw, 20px);
      height: auto;
      flex-shrink: 0;
    }

    /* Swap button */
    .swap-btn {
      width: clamp(40px, 10vw, 44px);
      height: clamp(40px, 10vw, 44px);
      min-width: clamp(40px, 10vw, 44px);
      border-radius: 50%;
      background: linear-gradient(145deg, #1e2a4a, #141e36);
      border: 1px solid var(--border-subtle);
      color: var(--gold-primary);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      box-shadow: 0 3px 10px rgba(0,0,0,0.3);
      transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
      margin-bottom: 2px;
      touch-action: manipulation;
      flex-shrink: 0;
    }
    
    .swap-btn:active {
      transform: rotate(180deg) scale(0.9);
    }
    
    .swap-btn svg {
      width: clamp(16px, 4vw, 18px);
      height: clamp(16px, 4vw, 18px);
    }

    /* ============================================================
       CONVERT BUTTON
       ============================================================ */
    .convert-btn {
      width: 100%;
      padding: clamp(13px, 3.5vw, 15px);
      border: none;
      border-radius: var(--radius-md);
      background: linear-gradient(135deg, var(--gold-primary), #b8943f);
      color: #0a0e1a;
      font-size: clamp(0.82rem, 2.2vw, 0.95rem);
      font-weight: 700;
      letter-spacing: clamp(1.2px, 0.4vw, 1.8px);
      text-transform: uppercase;
      cursor: pointer;
      box-shadow: var(--shadow-btn);
      transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
      position: relative;
      overflow: hidden;
      min-height: 48px;
      touch-action: manipulation;
    }
    
    .convert-btn::before {
      content: '';
      position: absolute;
      inset: 0;
      background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent 60%);
      pointer-events: none;
    }
    
    .convert-btn:active {
      transform: scale(0.97);
      box-shadow: var(--shadow-btn);
    }

    .convert-btn:disabled {
      opacity: 0.6;
      cursor: not-allowed;
    }

    /* ============================================================
       ERROR MESSAGE
       ============================================================ */
    .error-msg {
      font-size: clamp(0.72rem, 2vw, 0.78rem);
      color: #e07070;
      background: rgba(224, 112, 112, 0.1);
      border: 1px solid rgba(224, 112, 112, 0.25);
      border-radius: var(--radius-sm);
      padding: clamp(8px, 2vw, 9px) clamp(12px, 3vw, 14px);
      display: none;
      animation: shake 0.35s ease;
    }
    .error-msg.visible {
      display: block;
    }

    /* ============================================================
       RESULT PANEL
       ============================================================ */
    .result-panel {
      background: linear-gradient(135deg, rgba(201,168,76,0.08), rgba(26,38,80,0.5));
      border: 1px solid rgba(201,168,76,0.18);
      border-radius: var(--radius-lg);
      padding: clamp(18px, 4vw, 22px) clamp(20px, 4.5vw, 24px);
      display: none;
      flex-direction: column;
      gap: 6px;
      animation: popIn 0.35s cubic-bezier(.34,1.56,.64,1) both;
    }
    .result-panel.visible {
      display: flex;
    }
    .result-panel__label {
      font-size: clamp(0.65rem, 1.8vw, 0.7rem);
      text-transform: uppercase;
      letter-spacing: clamp(1.5px, 0.4vw, 2px);
      color: var(--gold-primary);
      font-weight: 600;
    }
    .result-panel__value {
      font-size: clamp(1.5rem, 5vw, 1.9rem);
      font-weight: 700;
      color: var(--text-primary);
      letter-spacing: -0.5px;
      line-height: 1.2;
      word-break: break-word;
    }
    .result-panel__value .currency-code {
      font-size: clamp(0.9rem, 2.5vw, 1rem);
      font-weight: 500;
      color: var(--text-muted);
      margin-left: 6px;
    }
    .result-panel__rate {
      font-size: clamp(0.7rem, 2vw, 0.76rem);
      color: var(--text-dim);
      margin-top: 4px;
    }
    .result-panel__rate .rate-highlight {
      color: var(--gold-primary);
      font-weight: 600;
    }

    /* ============================================================
       FOOTER
       ============================================================ */
    .footer {
      font-size: clamp(0.62rem, 1.8vw, 0.68rem);
      color: var(--text-dim);
      text-align: center;
      letter-spacing: 0.5px;
      animation: fadeSlideUp 0.5s ease 0.35s both;
      padding: 0 12px;
    }

    /* ============================================================
       KEYFRAME ANIMATIONS
       ============================================================ */
    @keyframes fadeSlideDown {
      from { opacity: 0; transform: translateY(-18px); }
      to   { opacity: 1; transform: translateY(0);     }
    }
    @keyframes fadeSlideUp {
      from { opacity: 0; transform: translateY(18px);  }
      to   { opacity: 1; transform: translateY(0);     }
    }
    @keyframes popIn {
      from { opacity: 0; transform: scale(0.92); }
      to   { opacity: 1; transform: scale(1);    }
    }
    @keyframes shake {
      0%, 100% { transform: translateX(0);   }
      25%      { transform: translateX(-6px); }
      75%      { transform: translateX(6px);  }
    }

    /* ============================================================
       MOBILE SPECIFIC OPTIMIZATIONS
       ============================================================ */
    @media (max-width: 520px) {
      body {
        padding: 16px 12px;
      }
      
      .card {
        border-radius: var(--radius-lg);
      }

      /* Prevent zoom on iOS when focusing inputs */
      input, select, textarea {
        font-size: 16px !important;
      }
    }

    @media (max-width: 360px) {
      body {
        padding: 12px 8px;
      }

      .currency-row {
        gap: 6px;
      }
    }

    /* iOS Safari specific fixes */
    @supports (-webkit-touch-callout: none) {
      body {
        min-height: -webkit-fill-available;
      }
    }

    /* Landscape mode adjustments */
    @media (max-height: 600px) and (orientation: landscape) {
      .container {
        gap: 16px;
      }
      
      .card {
        gap: 14px;
        padding: 20px 24px;
      }
      
      .dropdown-panel {
        max-height: 40vh;
      }
    }

